• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: I'm leaking memory
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >I'm leaking memory (From: "Brian O'Brien" <email@hidden>)
 >Re: I'm leaking memory (From: "Brian O'Brien" <email@hidden>)
 >Re: I'm leaking memory (From: John Stiles <email@hidden>)
 >Re: I'm leaking memory (From: "Brian O'Brien" <email@hidden>)
 >Re: I'm leaking memory (From: Ricky Sharp <email@hidden>)
 >Re: I'm leaking memory (From: "Brian O'Brien" <email@hidden>)

  • Prev by Date: Re: I'm leaking memory
  • Next by Date: Re: MVC problem
  • Previous by thread: Re: I'm leaking memory
  • Next by thread: Re: I'm leaking memory
  • Index(es):
    • Date
    • Thread