Friday, February 10, 2012
Google Custom Search

ClearCanvas Highlights

Download our Open Source software
Watch some Videos
Get the Source
Check out our Licensing
Join our  Forums
Some Research: OICR IPP-Trials

Our Community

Membership Membership:
Latest New User Latest: 孙磊
New Today New Today: 1
New Yesterday New Yesterday: 27
User Count Overall: 20591

People Online People Online:
Visitors Visitors: 12
Members Members: 2
Total Total: 14

Online Now Online Now:
01: dgicovate
02: 孙磊

ClearCanvas Community Forums

Unmanaged dll's - memory issues
Last Post 2009-11-23 03:43 PM by stiank81. 3 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Resolved
stiank81
Advanced Member
Advanced Member
Posts:33

--
2009-11-10 04:29 PM  

(sorry... The question was for some reason deleted when I edited it to set status to Resolved...)

stiank81
Advanced Member
Advanced Member
Posts:33

--
2009-11-11 04:27 PM  
Like suspected the ClearCanvas isn't to blame.. Turns out using the GetHbitmap() function leaves you with the responsibility of deleting the HBmp.. However, I'm not all in the clear yet though, so I'd appreciate some general feedback on whether there are any precautions to take when using the ClearCanvas library - memory vice. Is see that there are some classes with Dispose(). Am I required to call this when I'm done with the objects?

Cheers,
Stian
stewart
Senior Member
Senior Member
Posts:2033

--
2009-11-23 10:16 AM  
Hi, this is not a straightforward question to answer, but generally you should dispose any objects that you have created that don't belong to some other object. If you are simply interacting with objects contained within an ImageViewerComponent, then you can safely leave it up to the viewer to dispose it. Otherwise, any object you created in your code, you will need to dispose of it yourself.

All that being said, there are very few objects in CC that hold unmanaged resources, so although it's best practice to dispose objects that implement IDisposable, there are very few where it actually matters. The reason many of our classes implement IDisposable is because subclasses could reference an unmanaged resource that needs to be cleaned up.

Hope this helps,
Stewart
Real-time support available to Clinical Edition and Team Edition customers
stiank81
Advanced Member
Advanced Member
Posts:33

--
2009-11-23 03:43 PM  
Thanks. I am disposing the LocalSopDataSource, ImageSop and IPresentationImage. Without doing so there seemed to be a memory leak, but now it's all fine.

Stian
You are not authorized to post a reply.

Active Forums 4.1
Copyright 2011 ClearCanvas Inc.