Bug 121764

Summary: Incorrect AddRef Release counting in SWT
Product: [Eclipse Project] Platform Reporter: Veronika Irvine <veronika_irvine>
Component: SWTAssignee: Duong Nguyen <duongn>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: steve_northover
Version: 3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Veronika Irvine CLA 2005-12-21 14:39:55 EST
From Brian Thomson:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncomg/html/msdn_therules.asp

For parameters, the rules for memory allocation and for reference counting follow a similar pattern:

1.  [in] parameters are owned by the caller, who allocates and frees them.  The callee only duplicates or AddRefs an [in] parameter if it wants to store a copy that will be kept after the method returns.

2. ownership of [out] parameters and return values transfers from the callee to the caller, who will free or Release them.    The callee therefore must have done an AddRef without a corresponding Release. e.g. QueryInterface

3. [in out] parameters - the callee has to free or Release the initial value before overwriting it, so the caller must duplicate or AddRef it before the call.   After that point these behave like [out] parameters.
Comment 1 Eclipse Webmaster CLA 2019-09-06 16:15:59 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.