stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Travis Vitek (JIRA)" <>
Subject [jira] Updated: (STDCXX-577) purify reports leaked memory in stocks example
Date Thu, 10 Jan 2008 00:45:33 GMT


Travis Vitek updated STDCXX-577:

    Attachment: stdcxx-577.patch

2008-01-09  Travis Vitek  <>

* examples/include/stocks.h: Removed StockXchange destructor
* examples/tutorial/stocks.cpp: Add StockXchange destructor
that properly deallocates memory.
(main): Avoid allocation of facets when the locale that uses
them is not available. Change Xchange to hold pair values to
avoid having to deallocate those pairs explicitly. Cache the
locale initially imbued on stream, then restore it to ensure
that facets used by imbued locale is deallocated.

> purify reports leaked memory in stocks example 
> -----------------------------------------------
>                 Key: STDCXX-577
>                 URL:
>             Project: C++ Standard Library
>          Issue Type: Improvement
>          Components: Examples
>    Affects Versions: 4.2.0
>            Reporter: Travis Vitek
>            Assignee: Travis Vitek
>             Fix For: 4.2.1
>         Attachments: stdcxx-577.patch, stocks-valgrind.log, stocks.log
> It is pretty obvious from looking at the source that memory is being leaked. The destructor
for StockXchange doesn't deallocate memory allocated in StockXchange::add(), and the sl_pairs
allocated in main are never deallocated.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message