uru4000: Fix missing reference to image transfer
We might redo image transfers, but we only ever had one reference that was implicitly removed after the transfer completed. Add a new reference each time it is submitted and only free the last reference in the stop handler.
This commit is contained in:
parent
1754bd0204
commit
96fa0a96eb
1 changed files with 6 additions and 3 deletions
|
@ -663,7 +663,11 @@ imaging_run_state (FpiSsm *ssm, FpDevice *_dev)
|
||||||
case IMAGING_CAPTURE:
|
case IMAGING_CAPTURE:
|
||||||
self->img_lines_done = 0;
|
self->img_lines_done = 0;
|
||||||
self->img_block = 0;
|
self->img_block = 0;
|
||||||
fpi_usb_transfer_submit (self->img_transfer, 0, NULL, image_transfer_cb, NULL);
|
fpi_usb_transfer_submit (fpi_usb_transfer_ref (self->img_transfer),
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
image_transfer_cb,
|
||||||
|
NULL);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -799,8 +803,7 @@ imaging_complete (FpiSsm *ssm, FpDevice *dev, GError *error)
|
||||||
if (error)
|
if (error)
|
||||||
fpi_image_device_session_error (FP_IMAGE_DEVICE (dev), error);
|
fpi_image_device_session_error (FP_IMAGE_DEVICE (dev), error);
|
||||||
|
|
||||||
/* Freed by callback or cancellation */
|
g_clear_pointer (&self->img_transfer, fpi_usb_transfer_unref);
|
||||||
self->img_transfer = NULL;
|
|
||||||
|
|
||||||
g_free (self->img_data);
|
g_free (self->img_data);
|
||||||
self->img_data = NULL;
|
self->img_data = NULL;
|
||||||
|
|
Loading…
Reference in a new issue