Re: Hard code freeze break for Nautilus



On Sun, 2010-09-19 at 15:40 -0400, Matthias Clasen wrote:

> I share Vincent's sentiment that clearing the model in dispose is more
> correct; maybe done_loading should just be prepared to deal with model
> == NULL ? Your change is probably just as effective to prevent the
> crash, though.
> 
> The other fixes all look simple and correct to me, so +1 for the rest.

Fair enough; I pushed the three acked patches to gnome-2-32 and changed
gnome-2-32-fixes with a new patch for the remaining issue, which I'm
also attaching here.

Thanks,

Cosimo
>From bb37ac331a063fe30c2ff88b1f545c093466bb1e Mon Sep 17 00:00:00 2001
From: Cosimo Cecchi <cosimoc gnome org>
Date: Mon, 20 Sep 2010 15:02:02 +0200
Subject: [PATCH] list-view: check for model != NULL before unsetting the highlight

The model could be NULL there as a result of the view being previously
disposed.
---
 src/file-manager/fm-list-view.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c
index d01af6a..3f59959 100644
--- a/src/file-manager/fm-list-view.c
+++ b/src/file-manager/fm-list-view.c
@@ -2952,6 +2952,13 @@ list_view_notify_clipboard_info (NautilusClipboardMonitor *monitor,
                                  NautilusClipboardInfo *info,
                                  FMListView *view)
 {
+	/* this could be called as a result of _end_loading() being
+	 * called after _dispose(), where the model is cleared.
+	 */
+	if (view->details->model == NULL) {
+		return;
+	}
+
 	if (info != NULL && info->cut) {
 		fm_list_model_set_highlight_for_files (view->details->model, info->files);
 	} else {
-- 
1.7.2.3



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]