Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312722 - Missing AddRef in new Relation
Summary: Missing AddRef in new Relation
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 RC1   Edit
Assignee: Carolyn MacLeod CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-12 17:35 EDT by Carolyn MacLeod CLA
Modified: 2010-05-12 17:42 EDT (History)
1 user (show)

See Also:
Silenio_Quarti: review+


Attachments
patch (1.56 KB, patch)
2010-05-12 17:35 EDT, Carolyn MacLeod CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carolyn MacLeod CLA 2010-05-12 17:35:12 EDT
When a Relation is created, a reference needs to be counted right
away in the constructor. This prevents the object from being prematurely
released.

This is similar to the first patch in Bug 311821.

Also, this patch calls getAddress() directly to get the target address, which protects against null pointer exceptions.
Comment 1 Carolyn MacLeod CLA 2010-05-12 17:35:43 EDT
Created attachment 168277 [details]
patch
Comment 2 Carolyn MacLeod CLA 2010-05-12 17:42:57 EDT
Fixed > 20100512