Libpurple request events

Mark Doliner mark at kingant.net
Tue Jun 10 17:29:55 EDT 2008


On Tue, 10 Jun 2008 03:10:48 -0500, Mark Doliner wrote
> On Mon, 2 Jun 2008 20:03:51 +0200, Benjamin Arnaud wrote
> > Hey there, I'm developping a Qt client based on libpurple.
> > 
> > I'm getting closer to the BETA 1 release and I'm solving my warnings 
> > and asserts.
> > 
> > I have several of those with libpurple :
> > CRITICAL **: purple_request_close_width_handle: assertion 'handle != 
> > NULL' failed CRITICAL **: purple_notify_close_width_handle: 
> > assertion 'handle != NULL' failed
> > 
> > I assume this is because I'm catching those event and returning NULL,
> >  since I'm operating some action internaly without prompting the 
> > user with a dialog interface. What am I suppose to return to avoid 
> > that CRITICAL assert ?
> > 
> > Thanks.
> > Mr Arnaud.
> 
> Out of curiosity, which request events do you return NULL for? 
>  Don't you usually have to perform some action and call one of the 
> supplied callback functions?
> 
> That being said, it seems like this might be a bug in libpurple.  libpurple
> should probably not call purple_request_close_with_handle or
> purple_notify_close_with_handle if the handle is NULL.  Do you know 
> the where these calls are happening?  One way to determine the 
> source is by setting D_DEBUG=fatal_warnings when running your 
> application.  That will cause glib to assert() and crash when it 
> encounters these errors.  From there you can use gdb to get a 
> backtrace and see the call stack.
> 
> I'm wondering if the calls are coming from 
> purple_request_close_info() in libpurple/request.c.  It seems like 
> those should call purple_notify_close() instead of 
> purple_notify_close_with_handle().

Oh I see.  The calls to purple_notify_close_with_handle() and
purple_request_close_with_handle() are correct.  They exist so that the UI or
protocols can have another notify or request window close if the first request
window is closed.

But it's possible they should be surrounded by an if (info->ui_handle !=
NULL).  That's why I'm curious if there are valid scenarios for your request
uiops to return NULL.

-Mark




More information about the Devel mailing list