Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 312722

Summary: Missing AddRef in new Relation
Product: [Eclipse Project] Platform Reporter: Carolyn MacLeod <carolynmacleod4>
Component: SWTAssignee: Carolyn MacLeod <carolynmacleod4>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Silenio_Quarti
Version: 3.6Flags: Silenio_Quarti: review+
Target Milestone: 3.6 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch none

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