Re: [PATCH] Crash renaming empty selection (#131861)



On Feb 6, 2004, at 6:39 AM, Alexander Larsson wrote:

 	view = FM_DIRECTORY_VIEW (callback_data);
 	selection = fm_directory_view_get_selection (view);

-	file = NAUTILUS_FILE (selection->data);
-
- EEL_CALL_METHOD (FM_DIRECTORY_VIEW_CLASS, view, start_renaming_file, (view, file));
-	
-	nautilus_file_list_free (selection);
+	if (selection_not_empty_in_menu_callback (view, selection)) {
+		file = NAUTILUS_FILE (selection->data);
+ EEL_CALL_METHOD (FM_DIRECTORY_VIEW_CLASS, view, start_renaming_file, (view, file));
+		nautilus_file_list_free (selection);
+	}

Shouldn't the nautilus_file_list_free (selection) line be outside the if to avoid a storage leak?

    -- Darin




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