Skip to content
Snippets Groups Projects
Commit baaf1384 authored by Lars Kanis's avatar Lars Kanis
Browse files

Fix Segfault in final GC when using FXSplashWindow.

The internal object allocated when calling FXSplashWindow.new was FXSplashWindow instead
of FXRbSplashWindow, so that no FXRbUnregisterRubyObj() was called. Therefore the object
was double free'd.

Stacktrace was:
==11529== Invalid read of size 8
==11529==    at 0x9265BBC: FX::FXObject::getClassName() const (FXObject.cpp:280)
==11529==    by 0x862EE55: FXRbObject::freefunc(FX::FXObject*) (markfuncs.cpp:77)
==11529==    by 0x4EA6254: finalize_list (gc.c:2944)
==11529==    by 0x4EAAFC2: rb_gc_call_finalizer_at_exit (gc.c:3075)
==11529==    by 0x4E9773B: ruby_cleanup (eval.c:101)
==11529==    by 0x4E979C4: ruby_run_node (eval.c:244)
==11529==    by 0x4007FA: main (main.c:38)
==11529==  Address 0x75e24c0 is 0 bytes inside a block of size 248 free'd
==11529==    at 0x4C2A4BC: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==11529==    by 0x92B98AD: FX::FXSplashWindow::~FXSplashWindow() (FXSplashWindow.cpp:219)
==11529==    by 0x917C990: FX::FXComposite::~FXComposite() (FXComposite.cpp:304)
==11529==    by 0x929A5EF: FX::FXRootWindow::~FXRootWindow() (FXRootWindow.cpp:209)
==11529==    by 0x929A621: FX::FXRootWindow::~FXRootWindow() (FXRootWindow.cpp:211)
==11529==    by 0x9156DB9: FX::FXApp::~FXApp() (FXApp.cpp:4994)
==11529==    by 0x84912F3: FXRbApp::~FXRbApp() (FXRbApp.cpp:118)
==11529==    by 0x8491347: FXRbApp::~FXRbApp() (FXRbApp.cpp:127)
==11529==    by 0x862EF8E: FXRbObject::freefunc(FX::FXObject*) (markfuncs.cpp:92)
==11529==    by 0x4EA6254: finalize_list (gc.c:2944)
==11529==    by 0x4EAAFC2: rb_gc_call_finalizer_at_exit (gc.c:3075)
==11529==    by 0x4E9773B: ruby_cleanup (eval.c:101)
parent af543822
No related branches found
No related tags found
No related merge requests found
......@@ -148,6 +148,7 @@ include/FXRbShutter.h
include/FXRbShutterVirtuals.h
include/FXRbSlider.h
include/FXRbSpinner.h
include/FXRbSplashWindow.h
include/FXRbSplitter.h
include/FXRbStatusbar.h
include/FXRbStatusline.h
......
......@@ -166,6 +166,7 @@ FXRbIMPLEMENT(FXRbShutter,FXShutter,NULL,0)
FXRbIMPLEMENT(FXRbShutterItem,FXShutterItem,NULL,0)
FXRbIMPLEMENT(FXRbSlider,FXSlider,NULL,0)
FXRbIMPLEMENT(FXRbSpinner,FXSpinner,NULL,0)
FXRbIMPLEMENT(FXRbSplashWindow,FXSplashWindow,NULL,0)
FXRbIMPLEMENT(FXRbSplitter,FXSplitter,NULL,0)
FXRbIMPLEMENT(FXRbSpring,FXSpring,NULL,0)
FXRbIMPLEMENT(FXRbStatusBar,FXStatusBar,NULL,0)
......
......@@ -52,11 +52,17 @@ public:
long onPaint(FXObject*,FXSelector,void* PTR_EVENT);
public:
/// Construct splash window
FXSplashWindow(FXApp* a,FXIcon* ic,FXuint opts=SPLASH_SIMPLE,FXuint ms=5000);
%extend {
/// Construct splash window
FXSplashWindow(FXApp* a,FXIcon* ic,FXuint opts=SPLASH_SIMPLE,FXuint ms=5000){
return new FXRbSplashWindow(a,ic,opts,ms);
}
/// Construct splash window
FXSplashWindow(FXWindow* own,FXIcon* ic,FXuint opts=SPLASH_SIMPLE,FXuint ms=5000);
/// Construct splash window
FXSplashWindow(FXWindow* own,FXIcon* ic,FXuint opts=SPLASH_SIMPLE,FXuint ms=5000){
return new FXRbSplashWindow(own,ic,opts,ms);
}
}
/// Set the icon for the splash window
void setIcon(FXIcon* ic);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment