Skip to content

Commit d783151

Browse files
committed
add it back to the eye tracker script
1 parent 823732c commit d783151

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/eyeTracker.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,19 +228,22 @@
228228
% Exit program if this fails.
229229
elInit = Eyelink('Initialize');
230230
if elInit ~= 0
231+
Eyelink('shutdown');
231232
error([newline 'Eyelink is not initialized, aborted.']);
232233
end
233234

234235
% Make sure EL is still connected: returns 1 if connected, -1 if dummy-connected,
235236
% 2 if broadcast-connected and 0 if not connected. Exit program if this fails.
236237
elConnection = Eyelink('IsConnected');
237238
if elConnection ~= 1
239+
Eyelink('shutdown');
238240
error([newline 'Eyelink is not connected, aborted.']);
239241
end
240242

241243
% Initialize Eyelink system and connection: returns 1 when succesful, 0
242244
% otherwise
243245
if ~EyelinkInit(0, 1)
246+
Eyelink('shutdown');
244247
fprintf('Eyelink Init aborted.\n');
245248
return
246249
end

0 commit comments

Comments
 (0)