Bug 8511 - RefPtr: refcounting broken with cast_*() methods.
Summary: RefPtr: refcounting broken with cast_*() methods.
Status: RESOLVED FIXED
Alias: None
Product: cairomm
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Murray Cumming
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-05 06:29 UTC by Murray Cumming
Modified: 2007-07-14 10:26 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
cairomm_refptr_cast_refcount.patch (3.16 KB, patch)
2006-10-05 06:30 UTC, Murray Cumming
Details | Splinter Review

Description Murray Cumming 2006-10-05 06:29:11 UTC
This patch fixes the problem, but it adds an ugly public constructor. Any ideas
for how to avoid that?
Comment 1 Murray Cumming 2006-10-05 06:30:02 UTC
Created attachment 7269 [details] [review]
cairomm_refptr_cast_refcount.patch

2006-10-05  Murray Cumming  <murrayc@murrayc.com>

	* cairomm/refptr.h: Added RefPtr(object, refcount) constructor
	for use in cast_*(), so that the casted RefPtr shares the same
	refcount, avoiding an early deletion. I do not like making
	this constructor public, but I do not see another way.
Comment 2 Jonathon Jongsma 2006-10-05 20:28:20 UTC
Ugh.  That *is* ugly, isn't it?  I racked my brain for a while tonight trying to
think of other ways to do it, but I haven't come up with anything yet.  I'll
keep thinking though.
Comment 3 Jonathon Jongsma 2007-07-14 10:26:44 UTC
committed.  Will be in version 1.4.2


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.