mail[Wesnoth-commits] r28586 - in /trunk/src/gui/widgets: listbox.hpp settings.hpp window_builder.hpp window_builder_private.hpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by koraq on August 14, 2008 - 18:56:
Author: mordante
Date: Thu Aug 14 18:48:17 2008
New Revision: 28586

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28586&view=rev
Log:
Valgrid discovered some memory leaks.  The reference_counted objects aren't
stored in a intrusive_ptr so don't cleanup themselves.

This commit fixes tbuilder_grid pointers.

Modified:
    trunk/src/gui/widgets/listbox.hpp
    trunk/src/gui/widgets/settings.hpp
    trunk/src/gui/widgets/window_builder.hpp
    trunk/src/gui/widgets/window_builder_private.hpp

Modified: trunk/src/gui/widgets/listbox.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/listbox.hpp?rev=28586&r1=28585&r2=28586&view=diff
==============================================================================
--- trunk/src/gui/widgets/listbox.hpp (original)
+++ trunk/src/gui/widgets/listbox.hpp Thu Aug 14 18:48:17 2008
@@ -93,7 +93,7 @@
         */
        void scrollbar_click(twidget* caller);
 
-       void set_list_builder(tbuilder_grid* list_builder) 
+       void set_list_builder(tbuilder_grid_ptr list_builder) 
                { list_builder_ = list_builder; }
 
        void set_assume_fixed_row_size(bool assume = true) 
@@ -243,7 +243,7 @@
        tstate state_;
 
        /** It's possible to let the engine build the contents, we need the 
builder in that case */
-       tbuilder_grid* list_builder_;
+       tbuilder_grid_ptr list_builder_;
 
        /** Returns the scrollbar widget */
        tscrollbar_* scrollbar();

Modified: trunk/src/gui/widgets/settings.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/settings.hpp?rev=28586&r1=28585&r2=28586&view=diff
==============================================================================
--- trunk/src/gui/widgets/settings.hpp (original)
+++ trunk/src/gui/widgets/settings.hpp Thu Aug 14 18:48:17 2008
@@ -158,7 +158,7 @@
 
                // NOTE maybe we need the borders...
 
-               tbuilder_grid* scrollbar;
+               tbuilder_grid_ptr scrollbar;
 
        };
 };

Modified: trunk/src/gui/widgets/window_builder.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/window_builder.hpp?rev=28586&r1=28585&r2=28586&view=diff
==============================================================================
--- trunk/src/gui/widgets/window_builder.hpp (original)
+++ trunk/src/gui/widgets/window_builder.hpp Thu Aug 14 18:48:17 2008
@@ -80,6 +80,9 @@
        void read_extra(const config& cfg);
 };
 
+typedef boost::intrusive_ptr<tbuilder_grid> tbuilder_grid_ptr;
+typedef boost::intrusive_ptr<const tbuilder_grid> tbuilder_grid_const_ptr;
+
 class twindow_builder
 {
 public:
@@ -108,7 +111,7 @@
                
                std::string definition;
        
-               tbuilder_grid* grid;
+               tbuilder_grid_ptr grid;
        };
 
        std::vector<tresolution> resolutions;

Modified: trunk/src/gui/widgets/window_builder_private.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/window_builder_private.hpp?rev=28586&r1=28585&r2=28586&view=diff
==============================================================================
--- trunk/src/gui/widgets/window_builder_private.hpp (original)
+++ trunk/src/gui/widgets/window_builder_private.hpp Thu Aug 14 18:48:17 2008
@@ -116,10 +116,10 @@
 
        twidget* build () const;
 
-       tbuilder_grid* header;
-       tbuilder_grid* footer;
-
-       tbuilder_grid* list_builder;
+       tbuilder_grid_ptr header;
+       tbuilder_grid_ptr footer;
+
+       tbuilder_grid_ptr list_builder;
 
        /**
         * Listbox data.
@@ -177,7 +177,7 @@
 
        twidget* build () const;
 
-       tbuilder_grid* grid;
+       tbuilder_grid_ptr grid;
 };
 
 struct tbuilder_slider : public tbuilder_control
@@ -311,7 +311,7 @@
 
        twidget* build () const;
 
-       tbuilder_grid* grid;
+       tbuilder_grid_ptr grid;
 
 private:
        int retval_;




Related Messages


Powered by MHonArc, Updated Thu Aug 14 19:02:50 2008