Re: About #123691 - Permission Change Crash



On Thu, 2004-03-11 at 02:30, Martin Wehner wrote:
> Hey,
> 
> there's a problem with the property dialog: It doesn't unregister/cancel
> it's callbacks/operations. This leads to a crash when you close the
> dialog before all operations are finished. If you e.g. select multiple
> files, change the permissions and then quickly press alt-c or 'close',
> you'll most likely crash in fm_properties_window_get_type() (expanded
> from the FM_PROPERTIES_WINDOW cast macro in the callbacks).
> I think this is also a problem for the rename and group/owner callbacks,
> but much harder to trigger, because these changes aren't available for
> multi-file property windows (if the fs is really slow though..).
> 
> Here are two patches for your consideration, but both suck a bit:
> They both cancel pending permission changes when the window is
> destroyed, which is probably not what you'd expect when you press a
> button named 'close'. They also don't take into account that there may
> be other callbacks besides change_permission() which need to be
> cancelled (but the larger patch is intended to be expanded to do this -
> though a Hashtable  probably won't do the trick, because there might be
> multiple pending operations for one file). The more hackish (though less
> intrusive) patch doesn't even try to find out which files may have
> pending perm. ops, but cancels them for all.
> 
> I'd be thankful for any suggestions.

I think a better approach is to ref the propetry window before the
callback, and unref it when they get called. That way we won't lose the
changes made. Also, we need to take care to handle possible destroyed
(but not finalized) unrealized windows in the callbacks.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's an unconventional gay gangster She's a ditzy wisecracking college 
professor from a family of eight older brothers. They fight crime! 




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