On Sun, 24 Sep 2006 17:41:53 +0000, Eduardo Pérez wrote
> On 2006-09-22 17:28:20 UTC, Mark Doliner wrote:
> > On Fri, 22 Sep 2006 08:36:03 -0700, Mark Huetsch wrote
> > > On 9/17/06, Mark Doliner <mark@...> wrote:
> > > >
> > > > FYI I hope to make the use of GAIM_CONNECTION_IS_VALID not necessary in as
> > > > many places as possible. It's kind of a gross kludge, and shouldn't
> > > > really be
> > > > needed if timeouts are correctly canceled, watchers are destroyed, etc.
> > > >
> > > > So ideally someone will figure out why that check is needed.
> > >
> > > When we disable our account via gaim_account_enable(), we destroy our
> > > GaimConnection. If we do this between the call to
> > > gaim_proxy_connect() and our prpl's got_login() callback, we will be
> > > passing that callback a pointer to freed memory. Hence the check in
> > > those functions. Therefore, if we don't find some alternative to
> > > GAIM_CONNECTION_IS_VALID, all of the prpls should be using it.
> > gaim_proxy_connect() returns a pointer to a GaimProxyConnectData. The
> > alternative is to keep a reference to that struct (probably in gc), and cancel
> > the connection using gaim_proxy_connect_cancel() if the account is destroyed
> > before the connection attempt finishes.
> It seems like these problems would be solved by using GObject's
> reference counting, wouldn't it?
They could be fixed by using GObject reference counting, yes.