• 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: getline 'free' problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getline 'free' problem


  • Subject: Re: getline 'free' problem
  • From: Jason Foreman <email@hidden>
  • Date: Wed, 16 Sep 2009 09:42:44 -0500


On Sep 16, 2009, at 5:41 AM, Aron Nopanen wrote:

Hi All,

Not a Cocoa problem as such, but not sure if there's a better list for it:

For this question, Xcode-users is probably a better list.


On Snow Leopard (using gcc 4.2), I'm getting a 'double free' error in the guts of the C++ std::getline. The 'free' in question is being performed by std::string::reserve. This happens any time I run 'getline' (reading from cin) on a fresh, virgin string. (The error is only seen in the Debug configuration.)

Try removing these definitions from the preprocessor flags of your Debug configuration: "_GLIBCXX_DEBUG=1 _GLIBCXX_DEBUG_PEDANTIC=1" I think there are some issues when those are defined that can cause some unexpected behavior, such as what you're seeing.



Jason


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: getline 'free' problem
      • From: Aron Nopanen <email@hidden>
References: 
 >getline 'free' problem (From: Aron Nopanen <email@hidden>)

  • Prev by Date: Re: Upgrading NSDocument format, best practice
  • Next by Date: Re: Upgrading NSDocument format, best practice
  • Previous by thread: getline 'free' problem
  • Next by thread: Re: getline 'free' problem
  • Index(es):
    • Date
    • Thread