Re: g_object_ref() now propagates types

On 12/08/2017 03:26 AM, Philip Withnall wrote:
child_type = CHILD_TYPE (g_object_ref (parent_type));

Or my personal preference:

  g_object_ref (CHILD_TYPE (parent_type))

I was skeptical that this would catch many issues, but it actually caught a copy pasta for me a couple of days ago with something like:

 a->foo = g_object_ref (baz);
 a->bar = g_object_ref (baz);

when i changed foo to bar and forgot to modify baz.

So +1 already.

-- Christian

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