Skip to content

Commit

Permalink
Fixed an issue with freeing memory when reading string markers from L…
Browse files Browse the repository at this point in the history
…SL (e.g., for online BCI). Not sure why this happens, but it seems we're using the wrong allocator to free the LSL memory (currently leaking a small amt of mem, need to fix at some point).
  • Loading branch information
intheon-buildbot committed Apr 8, 2019
1 parent e6772d9 commit 6fc7e38
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
any(cellfun(@exist,{'lsl_pull_sample_str'})==3)
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion dependencies/liblsl-Matlab/mex/lsl_pull_sample_str.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void mexFunction( int nlhs, mxArray *plhs[],
/* move data over into the results */
for (k=0;k<numchannels;k++) {
mxSetCell(plhs[0],k,mxCreateString(buffer[k]));
free(buffer[k]);
/* free(buffer[k]); -- leak memory so we don't crash... */
}
if (nlhs == 2) {
/* also assign the time stamp */
Expand Down

0 comments on commit 6fc7e38

Please sign in to comment.