Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: dje@google.com (Doug Evans)
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC] [python] Fix field list of typedef regression
Date: Sat, 29 Oct 2011 22:17:00 -0000	[thread overview]
Message-ID: <m3mxcj7gsz.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20111029081242.9FA26246191@ruffy.mtv.corp.google.com> (Doug	Evans's message of "Sat, 29 Oct 2011 01:12:42 -0700 (PDT)")

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


  reply	other threads:[~2011-10-29 19:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-29  8:23 Doug Evans
2011-10-29 22:17 ` Tom Tromey [this message]
2011-11-10 18:52   ` [RFA] " Doug Evans
2011-11-10 19:11     ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3mxcj7gsz.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox