mail[Wesnoth-commits] r24577 - /trunk/src/gui/widgets/window.cpp


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

Header


Content

Posted by koraq on March 12, 2008 - 19:41:
Author: mordante
Date: Wed Mar 12 19:17:08 2008
New Revision: 24577

URL: http://svn.gna.org/viewcvs/wesnoth?rev=24577&view=rev
Log:
Avoid drawing a container without a widget, which lead to a crash.

Modified:
    trunk/src/gui/widgets/window.cpp

Modified: trunk/src/gui/widgets/window.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/window.cpp?rev=24577&r1=24576&r2=24577&view=diff
==============================================================================
--- trunk/src/gui/widgets/window.cpp (original)
+++ trunk/src/gui/widgets/window.cpp Wed Mar 12 19:17:08 2008
@@ -82,6 +82,10 @@
        layout(Xrect);
        for(tsizer::iterator itor = begin(); itor != end(); ++itor) {
 
+               if(! *itor) {
+                       continue;
+               }
+
                log_scope2(widget, "Draw child");
 
                itor->draw(screen);
@@ -120,11 +124,13 @@
 
                        for(tsizer::iterator itor = begin(); itor != end(); 
++itor) {
 
-                               if(itor->dirty()) {
-                                       log_scope2(widget, "Draw child");
-
-                                       itor->draw(screen);
+                               if(! *itor || !itor->dirty()) {
+                                       continue;
                                }
+
+                               log_scope2(widget, "Draw child");
+
+                               itor->draw(screen);
                        }
                        rect = get_rect();
                        SDL_BlitSurface(screen, 0, video_.getSurface(), 
&rect);




Related Messages


Powered by MHonArc, Updated Wed Mar 12 20:23:33 2008