[erlang-bugs] wxErlang: using wxSizer with wxStaticBox causes shell crash on frame close

Steve Davis steven.charles.davis@REDACTED
Sat Mar 14 16:25:27 CET 2009


Dan and co.

This is reproable on Windows XP SP3, I don't have another platform to 
hand...

The following function contains a line that causes a SHELL crash on 
frame close.

Note! the exactly equivalent code using wxPanel does not cause the crash.

%% Function causes shell to crash on top level window close... why?
box(Parent, Opts) ->
	GxName = get_atom(id, Opts),
	Label = get_string(label, Opts),
	Box = wxStaticBox:new(Parent, -1, Label),

	%% Do sizer stuff...
	Sizer = wxStaticBoxSizer:new(Box, ?wxVERTICAL),	
	wxWindow:setSizer(Box, Sizer),
	SizerFlags = wxSizerFlags:new(),
	wxSizerFlags:expand(SizerFlags),
	ParentSizer = wxWindow:getSizer(Parent),

% layout doesn't doesn't work without the following line...

	wxSizer:add(ParentSizer, Sizer, SizerFlags),

% ...but this sizer addition crashes the SHELL on top level window close

	wxSizer:fit(Sizer, Parent),	
	gx:register(GxName, Box).


BR,
Steve



More information about the erlang-bugs mailing list