Path: csiph.com!1.us.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!border1.nntp.ams1.giganews.com!nntp.giganews.com!buffer1.nntp.ams1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail NNTP-Posting-Date: Fri, 30 Sep 2016 16:13:29 -0500 From: Gareth Owen Newsgroups: comp.lang.c Subject: Re: Is there any place to talk about language features? References: <7f35f731-ab20-4bbe-a26e-8c3af67f6984@googlegroups.com> <5b93213c-4a2a-442d-96ca-c79bd09ed470@googlegroups.com> <3e7e20c2-c69d-4777-a98a-b7d212f546c9@googlegroups.com> <21af8abe-28fe-4447-b8a9-db1defa5a848@googlegroups.com> Date: Fri, 30 Sep 2016 22:13:29 +0100 Message-ID: <87shsht7k6.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:L98EIdS+bG9pZ4tbtt7EQZ8fKag= MIME-Version: 1.0 Content-Type: text/plain Lines: 15 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-rmlBmo2PytWxF5ElgvMQrSc01NuOyFSIRvN/LBlHQTh1Aeu5r0FLI4ilBLENHOq3tQyOFD9P27VUaWJ!MQiNHnkaf3TldFGIMuvadCuPgq8APq39s4zAKN/Yhl2DZbPUDKlEVTHJy7326Sh4s/DBdQ== X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2140 Xref: csiph.com comp.lang.c:94336 Thiago Adams writes: > On Friday, September 30, 2016 at 5:07:33 PM UTC-3, Ian Collins wrote: > I find easy to create shared objects in C. > > Object * p1 = Create(); //ref counted 1 > Object * p2 = NULL; > > p2 = Share(p1);//ref counted 2 > > Release(p1); //ref counted 1 > Release(p2); //destroyed Correctly releasing resources manually across all code paths is indeed easy. That's why C programs so rarely have memory leaks.