From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91710 invoked by alias); 16 Sep 2018 00:57:58 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 91699 invoked by uid 89); 16 Sep 2018 00:57:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=1678 X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 16 Sep 2018 00:57:56 +0000 Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 2346A1E175; Sat, 15 Sep 2018 20:57:54 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=simark.ca; s=mail; t=1537059475; bh=dKGYtK/WaWCuZnHBaHayQmB6+df2AkQv3HXl6einB2k=; h=Subject:To:References:From:Date:In-Reply-To:From; b=dH1N0G0aNUj2E9T5/x1qLpPFjCG6cmYHQqjVaQS/dG9pf51QMikUjVRB4pt7EP6Fn 6U415M5xFRHyi9XOW+Vg0tu+1Zq4xEL1/ZhURYeB9cI3+ruvclC3xehKA9+f+rUN8F ULHOp1Mmo2e9F6babvawlI+Ps3Uv3ysy/RUoVr4M= Subject: Re: [PATCH 1/4] Change pspace_to_pspace_object to return a new reference To: Tom Tromey , gdb-patches@sourceware.org References: <20180913053007.11780-1-tom@tromey.com> <20180913053007.11780-2-tom@tromey.com> From: Simon Marchi Message-ID: <435d6db2-bbe9-7f79-3e3d-55ca8f2da0bc@simark.ca> Date: Sun, 16 Sep 2018 00:57:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20180913053007.11780-2-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-09/txt/msg00511.txt.bz2 On 2018-09-13 1:30 a.m., Tom Tromey wrote: > diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c > index c2b40ff5352..8fd160c7bf8 100644 > --- a/gdb/python/py-objfile.c > +++ b/gdb/python/py-objfile.c > @@ -167,10 +167,8 @@ objfpy_get_progspace (PyObject *self, void *closure) > > if (obj->objfile) > { > - PyObject *pspace = pspace_to_pspace_object (obj->objfile->pspace); > - > - Py_XINCREF (pspace); > - return pspace; > + gdbpy_ref<> pspace = pspace_to_pspace_object (obj->objfile->pspace); > + return pspace.get (); > } Can you double check this, shouldn't it be .release()? Otherwise, LGTM. Simon