This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] [python] Fix field list of typedef regression


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]