Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > BOOK: Professional C++, 3rd Edition
BOOK: Professional C++, 3rd Edition
This is the forum to discuss the Wrox book Professional C++, 3rd Edition by Marc Gregoire,; ISBN: 978-1-118-85805-9
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional C++, 3rd Edition section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 15th, 2017, 11:55 AM
Registered User
Join Date: May 2017
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question Can't make 09_ConstructorError release already-allocated memory

I've been fiddling with the 09_ConstructorError example, changing the line

Matrix m(10, 10);
to use different widths and heights. What I've found is that I can't seem to make it act as it's supposed to, i.e. to allocate memory until allocation finally fails, and then delete[] all the previously-allocated 1-dimensional arrays and then exits with a bad_alloc exception. Instead, if I use small to moderate values for the matrix bounds, it just allocates successfully and exits normally; but if I set really high bounds, it exits with a SIGKILL, apparently without releasing any of the already-allocated arrays (I can tell because I've put some debug statements in the deallocation part).

I've tried this on Mac OS X and Linux, but not Windows. What am I doing wrong?

Last edited by echristopherson; May 15th, 2017 at 12:00 PM.. Reason: code tags

Similar Threads
Thread Thread Starter Forum Replies Last Post
Book release date and .NET Core release date Joakeim BOOK: Professional C# 6 and .NET Core 1.0 4 June 11th, 2016 01:25 PM
File release Jeremy.Carter Javascript How-To 2 May 27th, 2011 04:54 AM
Release problem jeusdi .NET Framework 1.x 0 February 27th, 2007 11:19 AM
Release date Daniel.K62 BOOK: Beginning C# 2005 Databases 2 October 30th, 2006 03:00 PM
Memory Release for SQL Server 2000 ajkulkarni SQL Server 2000 3 September 23rd, 2004 03:32 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.