[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/4] psppire-dict: Unset dict callback on dispose.
From: |
Ben Pfaff |
Subject: |
Re: [PATCH 3/4] psppire-dict: Unset dict callback on dispose. |
Date: |
Sun, 08 Jul 2012 22:13:53 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
John Darrington <address@hidden> writes:
> 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.
It won't do anything bad, so I'm going to leave that alone.
Thanks,
Ben.
[PATCH 2/4] psppire-dict: Make PsppireDict not own its "struct dictionary"., Ben Pfaff, 2012/07/08
Re: [PATCH 0/4] bug fixes for master, Ben Pfaff, 2012/07/08