pspp-dev
[Top][All Lists]
Advanced

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

Re: [PATCH 3/4] psppire-dict: Unset dict callback on dispose.


From: John Darrington
Subject: Re: [PATCH 3/4] psppire-dict: Unset dict callback on dispose.
Date: Sun, 8 Jul 2012 07:12:50 +0000
User-agent: Mutt/1.5.18 (2008-05-17)

On Sat, Jul 07, 2012 at 11:49:15PM -0700, Ben Pfaff wrote:
     If the PsppireDict is destroyed before its dictionary, then
     it is important to avoid getting callbacks into the freed
     PsppireDict.

     +static void
     +psppire_dict_dispose (GObject *object)
     +{
     +  PsppireDict *d = PSPPIRE_DICT (object);
     +
     +  dict_set_callbacks (d->dict, NULL, NULL);
     +
     +  G_OBJECT_CLASS (parent_class)->dispose (object);
     +}

Normally, we need to have some mechanism to render _dispose
impotent if it gets called more than once for the same instance.
I don't know if dict_set_callbacks could do anything bad if it 
gets called multiple times. If it could, then we need to add a
dispose_has_run flag here.


J'

-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://keys.gnupg.net or any PGP keyserver for public key.

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]