[Inc. Repainting] Fix for nil dereference

David Hyatt hyatt at apple.com
Tue Sep 30 12:41:20 CEST 2003


I'm going to use "[Inc. Repainting]" in the subject line to talk about 
any patches related to the experimental repainting code I landed.

This patch fixes a nil dereference caused by my change to make 
m_needsLayout be false initially instead of true.

Index: khtml/rendering/render_replaced.cpp
===================================================================
RCS file: 
/local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_replaced.cpp,v
retrieving revision 1.40
diff -u -p -r1.40 khtml/rendering/render_replaced.cpp
--- khtml/rendering/render_replaced.cpp	2003/09/23 14:47:30	1.40
+++ khtml/rendering/render_replaced.cpp	2003/09/30 18:37:23
@@ -190,8 +190,9 @@ void RenderWidget::setQWidget(QWidget *w
              connect( m_widget, SIGNAL( destroyed()), this, SLOT( 
slotWidgetDestructed()));
              m_widget->installEventFilter(this);
              // if we've already received a layout, apply the 
calculated space to the
-            // widget immediately
-            if (!needsLayout()) {
+            // widget immediately, but we have to have really been 
full constructed (with a non-null
+            // style pointer).
+            if (!needsLayout() && style()) {
  		resizeWidget( m_widget,
  			      
m_width-borderLeft()-borderRight()-paddingLeft()-paddingRight(),
  			      
m_height-borderLeft()-borderRight()-paddingLeft()-paddingRight() );



More information about the Khtml-devel mailing list