This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] [python] Fix field list of typedef regression
- From: Tom Tromey <tromey at redhat dot com>
- To: dje at google dot com (Doug Evans)
- Cc: gdb-patches at sourceware dot org
- Date: Sat, 29 Oct 2011 13:12:44 -0600
- Subject: Re: [RFC] [python] Fix field list of typedef regression
- References: <20111029081242.9FA26246191@ruffy.mtv.corp.google.com>
>>>>> "Doug" == Doug Evans <dje@google.com> writes:
Doug> Question: What's the right way to handle ref counting here?
Doug> + CHECK_TYPEDEF (checked_type);
Doug> + if (checked_type != type)
Doug> + self = type_to_type_object (checked_type);
Doug> + /* FIXME: reference counting of self? */
type_to_type_object returns a new reference.
So the caller is responsible for decref'ing it.
I think assigning to self is unexpected.
Doug> + }
Doug> + GDB_PY_HANDLE_EXCEPTION (except);
I'd pull the type_to_type_object call out of the TRY_CATCH.
Then you don't have to handle a decref on the exception return.
Tom