im.pidgin.pidgin: d77adf1b9a4b44f121620f20e2643602e3f6776e

Evan Schoenberg evands at pidgin.im
Wed Jan 23 06:44:08 EST 2008


On Jan 22, 2008, at 8:58 PM, Mark Doliner wrote:

>
> PURPLE_CONNECTION_IS_VALID is not necessary in correctly written  
> code.  Code
> should keep track of the return value from g_timout_add() and use it  
> to cancel
> the timer when the object is freed.
>
>
> GObjectification might make this process a little easier and less  
> manual, but
> it is certainly not required.

Not only timer tracking is needed, but the UI must always note when a  
connection is destroyed and either close or invalidate in some way any  
UI element whose response will callback in a way which uses the  
connection.  This is particularly problematic if, say, a Jabber  
connection displays a prompt and passes its JabberStream, which keeps  
track of a connection in its 'gc' member.... the  
purple_*_close_by_handle() take care of this case, but it's another  
layer of complexity worth pointing out.  "Correctly written code" can  
work around the way this struct can be released out from under it...  
but reference counting is surely a better solution since it doesn't  
require any assumptions outside the current function invocation.

*snip*
> We don't need a replacement... just keep track of timers and cancel  
> them
> appropriately.

So given that it appears the code is creating one-and-only-one timer  
in one place and removing it as appropriate, do you have thoughts how  
the crash log and disassembly I posted in my previous message in this  
thread exist?

-Evan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.im/pipermail/devel/attachments/20080123/92e32deb/attachment.html>


More information about the Devel mailing list