From: Reece Dunn (msclrhd_at_[hidden])
Date: 2004-08-26 05:11:36
Ralf W. Grosse-Kunstleve wrote:
>--- Reece Dunn <msclrhd_at_[hidden]> wrote:
> > Thus, in Java Swing-style C++, you can do something like:
> > boost::gui::frame * main = new boost::gui::frame( "My GUI App" );
> > frame -> set_pane( new boost::gui::button( "PUSH" ));
> > frame -> set_size( 500, 400 );
> > frame -> show();
> > boost::gui::message_loop msg;
> > return msg.execute();
>How does main get deallocated here?
>I am very surprised to see "new" and raw pointers in a library designed
>scratch. Manual lifetime management is going to lead to a lot of clutter,
>memory leaks, and is incompatible with exception handling. A system based
>smart pointers like boost::shared_ptr and reference-counted container types
The library currently uses reference counted types to manage allocated
types. I understand the use of smart pointers and agree that it is
essential. I was just using this example as a guideline.
Want to block unwanted pop-ups? Download the free MSN Toolbar now!