diff options
author | Alexander Larsson <alla@lysator.liu.se> | 2002-05-13 03:31:05 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2002-05-13 03:31:05 +0000 |
commit | 889efa286aa327ec3261774039312f2ac7af6a19 (patch) | |
tree | 764249791611a7b1e2188d3a1a8d66457b227a31 | |
parent | b3e25c8c4ce10b15a6b64a6aeefa9fa44753bd98 (diff) | |
download | nautilus-889efa286aa327ec3261774039312f2ac7af6a19.tar.gz |
Make sure to keep a ref to the view until we got the response. Handle the
2002-05-12 Alexander Larsson <alla@lysator.liu.se>
* src/file-manager/fm-directory-view.c
(clipboard_targets_received, real_update_menus):
Make sure to keep a ref to the view until we got the response.
Handle the case the detail->ui was destroyed (it's a weak ref).
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/file-manager/fm-directory-view.c | 11 |
2 files changed, 14 insertions, 4 deletions
@@ -1,3 +1,10 @@ +2002-05-12 Alexander Larsson <alla@lysator.liu.se> + + * src/file-manager/fm-directory-view.c + (clipboard_targets_received, real_update_menus): + Make sure to keep a ref to the view until we got the response. + Handle the case the detail->ui was destroyed (it's a weak ref). + 2002-05-10 Dave Camp <dave@ximian.com> * src/file-manager/fm-directory-view.c (process_new_files): Handle diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c index 55063fd07..ac2e5619c 100644 --- a/src/file-manager/fm-directory-view.c +++ b/src/file-manager/fm-directory-view.c @@ -4190,7 +4190,7 @@ clipboard_targets_received (GtkClipboard *clipboard, view = FM_DIRECTORY_VIEW (user_data); can_paste = FALSE; - + if (gtk_selection_data_get_targets (selection_data, &targets, &n_targets)) { for (i=0; i < n_targets; i++) { if (targets[i] == copied_files_atom) { @@ -4201,9 +4201,11 @@ clipboard_targets_received (GtkClipboard *clipboard, g_free (targets); } - nautilus_bonobo_set_sensitive (view->details->ui, - FM_DIRECTORY_VIEW_COMMAND_PASTE_FILES, - can_paste); + if (view->details->ui != NULL) + nautilus_bonobo_set_sensitive (view->details->ui, + FM_DIRECTORY_VIEW_COMMAND_PASTE_FILES, + can_paste); + g_object_unref (view); } static void @@ -4410,6 +4412,7 @@ real_update_menus (FMDirectoryView *view) FALSE); } else { /* Ask the clipboard */ + g_object_ref (view); /* Need to keep the object alive until we get the reply */ gtk_clipboard_request_contents (gtk_clipboard_get (GDK_SELECTION_CLIPBOARD), gdk_atom_intern ("TARGETS", FALSE), clipboard_targets_received, |