Re: I'm leaking memory
Re: I'm leaking memory
- Subject: Re: I'm leaking memory
- From: "W. W. Gilpin" <email@hidden>
- Date: Fri, 11 Feb 2005 15:01:43 -0600
@interface dicomSCP : NSObject {
std::string myAET;
std::list<std::string> acceptAETs;
int portno;
}
Was I supposed to have initialized these some how?
Brian,
From "Using C++ With Objective-C":
http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/
LanguageOverview/chapter_3_section_10.html
"Objective-C++ similarly strives to allow C++ class instances to serve
as instance variables. This is possible as long as the C++ class in
question (along with all of its superclasses) does not have any virtual
member functions defined. If any virtual member functions are present,
the C++ class may not serve as an Objective-C instance variable."
[...]
"If a C++ class has any user-defined constructors or destructors, they
are not called."
You need to make your myAET and accpetAETs member variables pointers
instead of objects, then initialize them in your class's designated
initializer. (Probably -(id)init)
W. W. Gilpin
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden