Commit e69640f9 authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson
Browse files

Don't ref directory twice. Rename finalizer.

2003-05-23  Alexander Larsson  <alexl@redhat.com>

	* libnautilus-private/nautilus-desktop-icon-file.c:
	Don't ref directory twice. Rename finalizer.

	* libnautilus-private/nautilus-desktop-link-monitor.c:
	unref monitor on shutdown
	Unref correct object in finalize

	* libnautilus-private/nautilus-desktop-link.c:
	unref icon file in finalizer.
parent 9af58231
2003-05-23 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-desktop-icon-file.c:
Don't ref directory twice. Rename finalizer.
* libnautilus-private/nautilus-desktop-link-monitor.c:
unref monitor on shutdown
Unref correct object in finalize
* libnautilus-private/nautilus-desktop-link.c:
unref icon file in finalizer.
2003-05-23 Alexander Larsson <alexl@redhat.com>
 
* libnautilus-private/nautilus-desktop-link-monitor.c (create_volume_link):
Fix the volume uniquification code.
2003-05-23 Alexander Larsson <alexl@redhat.com>
 
* src/file-manager/fm-icon-view.c (fm_icon_view_screen_changed):
......
......@@ -279,7 +279,6 @@ nautilus_desktop_icon_file_new (NautilusDesktopLink *link)
eazel_dump_stack_trace ("\t", 10);
#endif
nautilus_directory_ref (directory);
file->details->directory = directory;
icon_file = NAUTILUS_DESKTOP_ICON_FILE (file);
......@@ -309,7 +308,7 @@ nautilus_desktop_icon_file_get_link (NautilusDesktopIconFile *icon_file)
}
static void
desktop_finalize (GObject *object)
desktop_icon_file_finalize (GObject *object)
{
NautilusDesktopIconFile *desktop_file;
......@@ -329,7 +328,7 @@ nautilus_desktop_icon_file_class_init (gpointer klass)
object_class = G_OBJECT_CLASS (klass);
file_class = NAUTILUS_FILE_CLASS (klass);
object_class->finalize = desktop_finalize;
object_class->finalize = desktop_icon_file_finalize;
file_class->monitor_add = desktop_icon_file_monitor_add;
file_class->monitor_remove = desktop_icon_file_monitor_remove;
......
......@@ -30,6 +30,7 @@
#include "nautilus-desktop-directory.h"
#include "nautilus-global-preferences.h"
#include <eel/eel-debug.h>
#include <eel/eel-gtk-macros.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-vfs-extensions.h>
......@@ -62,12 +63,21 @@ EEL_CLASS_BOILERPLATE (NautilusDesktopLinkMonitor,
G_TYPE_OBJECT)
static NautilusDesktopLinkMonitor *link_monitor = NULL;
static void
destroy_desktop_link_monitor (void)
{
if (link_monitor != NULL) {
g_object_unref (link_monitor);
}
}
NautilusDesktopLinkMonitor *
nautilus_desktop_link_monitor_get (void)
{
if (link_monitor == NULL) {
link_monitor = NAUTILUS_DESKTOP_LINK_MONITOR (g_object_new (NAUTILUS_TYPE_DESKTOP_LINK_MONITOR, NULL));
eel_debug_call_at_shutdown (destroy_desktop_link_monitor);
}
return link_monitor;
}
......@@ -317,7 +327,7 @@ desktop_link_monitor_finalize (GObject *object)
}
if (monitor->details->trash_link != NULL) {
g_object_unref (monitor->details->home_link);
g_object_unref (monitor->details->trash_link);
monitor->details->trash_link = NULL;
}
......
......@@ -394,6 +394,8 @@ desktop_link_finalize (GObject *object)
if (link->details->icon_file != NULL) {
nautilus_desktop_icon_file_remove (link->details->icon_file);
nautilus_file_unref (NAUTILUS_FILE (link->details->icon_file));
link->details->icon_file = NULL;
}
if (link->details->type == NAUTILUS_DESKTOP_LINK_HOME) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment