Bug 121764 - Incorrect AddRef Release counting in SWT
Summary: Incorrect AddRef Release counting in SWT
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Duong Nguyen CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-21 14:39 EST by Veronika Irvine CLA
Modified: 2019-09-06 16:15 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.