After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 151463 - GnomeVFSVolumeMonitor should not be refcounted
GnomeVFSVolumeMonitor should not be refcounted
Status: RESOLVED WONTFIX
Product: gnome-vfs
Classification: Deprecated
Component: Other
cvs (head)
Other All
: High major
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
Depends on:
Blocks:
 
 
Reported: 2004-08-31 00:11 UTC by Federico Mena Quintero
Modified: 2008-09-06 19:17 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10



Description Federico Mena Quintero 2004-08-31 00:11:03 UTC
gnome_vfs_get_volume_monitor() does basically this:

  if (!the_global_monitor)
    the_global_monitor = gnome_vfs_volume_monitor_new ();

  return the_global_monitor;

This leads to unclear memory management.  It would be better to return a ref to
the existing monitor if it has already been created.

See bug #145200 for a related issue.
Comment 1 Federico Mena Quintero 2004-08-31 01:10:21 UTC
Also, when the refcount of the volume monitor drops to zero, the global
the_volume_monitor variable should be set to NULL.
Comment 2 Christophe Fergeau 2004-08-31 07:25:44 UTC
*** Bug 151244 has been marked as a duplicate of this bug. ***
Comment 3 Alexander Larsson 2004-08-31 07:36:23 UTC
A ref? The volume monitor is a singleton that is guaranteed to not go away. 

Anyway, making it take a ref is an ABI break that will make all current uses
leaks. (Not to mention much more complicated for no apparent reason.)
Comment 4 Alexander Larsson 2004-08-31 07:51:40 UTC
I guess the real bug is that the file selector doesn't call gnome_vfs_shutdown.
Comment 5 Federico Mena Quintero 2004-08-31 14:41:50 UTC
OK, so should I retitle this bug to "GnomeVFSVolumeMonitor should not be
refcounted", and provide a patch to make the ref/unref functions no-ops?

Code will still do g_object_ref/unref(), of course (e.g. the signal emission
code).  Apps would of course be buggy if they did one g_object_unref() too many
on the volume monitor.  We can flame people about this in the finalize function.
Comment 6 Alexander Larsson 2004-08-31 14:45:03 UTC
See bug 151244 for why ref/unref might still be useful.
It also has a patch that includes the flame on finalize if gnome_vfs_shutdown
wasn't called. The patch is currently sent to the release-team for consideration.
Comment 7 Christian Neumair 2005-05-07 09:26:22 UTC
Can we have a decision on this? Should the singleton be ref-counted or not?
Comment 8 André Klapper 2008-09-06 19:17:49 UTC
gnome-vfs has been deprecated and superseded by gio/gvfs since GNOME 2.22, hence mass-closing many of the gnome-vfs requests/bug reports. This means that gnome-vfs is NOT actively maintained anymore, however patches are still welcome.

If your reported issue is still valid for gio/gvfs, please feel free to file a bug report against glib/gio or gvfs.

@Bugzilla mail recipients: query for gnome-vfs-mass-close to get rid of these notification emails all together.


General further information: http://en.wikipedia.org/wiki/GVFS 
Reasons behind this decision are listed at http://www.mail-archive.com/gnome-vfs-list@gnome.org/msg00899.html