File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -409,6 +409,19 @@ void ADAravis::shutdownPortDriver() {
409409 pollingLoop.exitWait ();
410410
411411 ADGenICam::shutdownPortDriver ();
412+
413+ // This would normally go in the destructor. But on old versions of asyn,
414+ // the driver is not deleted after shutdown completes, and the following
415+ // steps are needed to disconnect the camera.
416+ arv_stream_set_emit_signals (stream, false );
417+ g_object_unref (stream);
418+ g_object_unref (camera);
419+
420+ // This makes it easier to find use-after-free.
421+ stream = NULL ;
422+ genicam = NULL ;
423+ device = NULL ;
424+ camera = NULL ;
412425}
413426
414427ADAravis::~ADAravis () {
@@ -419,9 +432,6 @@ ADAravis::~ADAravis() {
419432 if (!exiting) {
420433 shutdownPortDriver ();
421434 }
422-
423- g_object_unref (camera);
424- camera = NULL ;
425435}
426436
427437asynStatus ADAravis::makeCameraObject () {
You can’t perform that action at this time.
0 commit comments