• 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: cocoa app using external c++ code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cocoa app using external c++ code


  • Subject: Re: cocoa app using external c++ code
  • From: John Stiles <email@hidden>
  • Date: Sat, 01 Apr 2006 08:10:56 -0800

What does the destructor of Otherclass do?


Paul Forgey wrote:
I have a cocoa app written using objc++ using external c++ code. Any external classes allocated via new crash the heap if I delete them. If I enable Guard Malloc I get this message:

GuardMalloc[Administration Console-1883]: Tried to free pointer at 0xb161d6cc which is not currently a pointer to a malloc buffer.
GuardMalloc[Administration Console-1883]: Explicitly trapping into debugger!!!


Which pretty much agrees with what malloc_printf complains about with it turned off. I know for a fact I am not disturbing the state of the heap, as I can cause this to happen first thing in main before running any actual code:

// main.mm

int main (int argc, char *argv[])
{
  Otherclass *x = new Otherclass ();
  delete x; // CRASH
  ..
}

What's going on?? I can't find any compiler options XCode is setting that would disturb alignment or anything. In fact my working C++ command line programs all see the same sizes and layouts the cocoa app does.


------------------------------------------------------------------------

 _______________________________________________
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
_______________________________________________
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


  • Follow-Ups:
    • Re: cocoa app using external c++ code
      • From: Paul Forgey <email@hidden>
  • Prev by Date: Re: String memory leak
  • Next by Date: Re: vImage crop?
  • Previous by thread: Re: cocoa app using external c++ code
  • Next by thread: Re: cocoa app using external c++ code
  • Index(es):
    • Date
    • Thread