Project

General

Profile

Actions

Bug #568

closed

following NULL pointer in WLayout::setParentLayout

Added by Anonymous over 13 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
-
Start date:
10/21/2010
Due date:
% Done:

0%

Estimated time:

Description

Hi,

I'm in a debugger right now looking at a stack trace from trying to add a WHBoxLayout to a WGridLayout. Specifically it's being added at (1,0) of a grid with spans (1,2).

In WLayout::updateRemoveItem there is a call to item~~setParentLayout(0) at line 128. In that method, the parameter is called layout and there is a call to layout~~>addChild(this) at line 185, without a NULL check.

Unless I'm missing something, wouldn't it always be bad to pass a NULL to setParentLayout?

Thanks,

Sean

s. At one point last week I had a very strange crash that included an "impossible" stack trace - one where the stack abruptly jumped to a different virtual method than was possible according to the inheritance hierarchy. Compiling Wt without -O2 resolved that and since then I've only used the non-release library, so I don't think it's the issue this time.

Actions #1

Updated by Sean Hogan over 13 years ago

Sorry I filed that without signing in first... it was me.

Sean Hogan

Actions #2

Updated by Sean Hogan over 13 years ago

One more thing... I just realized I had the row number wrong: I should have been adding at (2,0), but used (1,0) instead. That location already had an item assigned (a layout) so it went into the WGridLayout::addItem logic to replace an existing item.

Actions #3

Updated by Koen Deforche over 13 years ago

  • Status changed from New to Resolved
  • Assignee set to Koen Deforche

Hey Sean,

This is something that was already fixed in latest git (and we are close to a release !):

void WLayout::setParentLayout(WLayout *layout)
{
  if (layout)
    layout->addChild(this);
  else
    setParent(0);
}

Regards,

koen

Actions #4

Updated by Sean Hogan over 13 years ago

Cool, thanks. Looking forward to the new release.

Actions #5

Updated by Koen Deforche over 13 years ago

  • Status changed from Resolved to Closed

Fixed in 3.1.6

Actions

Also available in: Atom PDF