Fix a memory leak.
A new buffer is allocated for each dive, but only the last one is freed. Since the code is already prepared to simply re-use the same buffer, there is no need to allocate those extra buffers.
This commit is contained in:
parent
0899486378
commit
ce82829284
@ -672,9 +672,6 @@ suunto_eonsteel_device_foreach(dc_device_t *abstract, dc_dive_callback_t callbac
|
||||
break;
|
||||
if (!callback(dc_buffer_get_data(file), dc_buffer_get_size(file), NULL, 0, userdata))
|
||||
skip = 1;
|
||||
|
||||
// We've used up the buffer, so create a new one
|
||||
file = dc_buffer_new(0);
|
||||
}
|
||||
progress.current++;
|
||||
device_event_emit(abstract, DC_EVENT_PROGRESS, &progress);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user