GNOME Bugzilla – Bug 168091
"Error connecting to camera" upon second import
Last modified: 2006-11-03 13:00:35 UTC
After having imported photos using libgphoto2, trying to do so again gives an error message: Error connection to camera. Received error "could not lock the device" while connecting to camera" Workarounds are: * Restarting f-spot * Unplugging the camera and plugging it in again
I get theis sometimes but trying to connect again usually fixes it for me. It is possible something is not being reset properly between invocations. I'll try to look into it soon
There are issues with refcounting and the gphoto objects. I need to look deeper into the libgphoto2 api and the bindings.
Similar to Bug #331524 – Cancel import from camera makes it impossible to reimport
*** Bug 331524 has been marked as a duplicate of this bug. ***
This will fix the bug (GPhotoCamera.cs) Index: src/GPhotoCamera.cs =================================================================== RCS file: /cvs/gnome/f-spot/src/GPhotoCamera.cs,v retrieving revision 1.10 diff -u -p -r1.10 GPhotoCamera.cs --- src/GPhotoCamera.cs 25 Sep 2006 20:29:00 -0000 1.10 +++ src/GPhotoCamera.cs 3 Nov 2006 12:47:24 -0000 @@ -230,18 +230,19 @@ public class GPhotoCamera foreach (GPhotoCameraFile curcamfile in files) curcamfile.ReleaseGPhotoResources (); - // FIXME check to make sure we don't need to dispose of these - // things explicitly. - /* if (camera_fs != null) camera_fs.Dispose (); if (camera != null) camera.Dispose (); + // FIXME check to make sure we don't need to dispose of these + // things explicitly. + /* camera_list.Dispose (); abilities_list.Dispose (); port_info_list.Dispose (); */ + context.Dispose (); } } So, apparently, we need to dispose camera and camera_fs
Fixed in CVS