Re: Hard code freeze break for Nautilus



>
>>  + "Clear the list model in _finalize() instead of _dispose()"
>>    I don't get this one. That's supposed to happen in dispose(), so I'm
>>    not sure why moving things in finalize() would be better. Can you
>>    elaborate?
>
> Sure; FMListView is a FMDirectoryView. fm_directory_view_end_loading(),
> and its subclass implementation fm_list_view_end_loading() might be
> called both as a result of a successful directory change or when the
> view is destroyed. In the latter case what happens is:
>
> - dispose() is called on FMListView; the model is cleared
> - destroy() is called on FMDirectoryView;
> - fm_list_view_done_loading() is called, which then calls into the model
> - crash
>
> By moving the cleanup of the model in finalize() we ensure that the
> model is always there when end_loading() is called.
>

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.


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