Skip to content
Snippets Groups Projects
  1. Jun 13, 2015
    • Lars Kanis's avatar
      Add gvl wrapper for FXDrawable.resize() . · 6be76a6f
      Lars Kanis authored
      This is just enough for loadPixel/savePixel, but if other methods
      release the GVL, potentially all other callback functions could
      be called. These are now yet wrapped by gvl-aware wrappers.
      6be76a6f
  2. Jun 12, 2015
  3. Feb 20, 2015
  4. Feb 19, 2015
    • Lars Kanis's avatar
    • Lars Kanis's avatar
      Discard borrowed object wrappers after method calls into Ruby. · 54a11707
      Lars Kanis authored
      This solves crashes of kind:
      	[BUG] rb_gc_mark(): 0x00000003f54af8 is T_ZOMBIE
      
      All parameters to Ruby event blocks or overloaded methods are converted to
      proper Ruby classes or wrapped by appropriate wrapper classes for borrowed
      objects. The wrapper classes are registered, to keep the connection between
      C-pointer (the borrowed object) and the wrapping Ruby object. This connection
      is canceled either when the borrowed object is destroyed or the Ruby wrapper
      is free'd. If neither of them happens, the wrapper object is re-used for the
      next call.
      
      This worked good with Ruby-1.8, which has one big mark and sweep run.
      Ruby-2.2 introduced incremental GC and has several mark and sweep runs, so
      that marks and sweeps are quite independent. Therefor we re-used objects,
      that are already maked for sweeping (so called T_ZOMBIE).
      
      This patch releases the connection between borrowed object and it's wrapper
      object after each call into Ruby code. Therefore the wrapper object isn't
      re-used, but a new one is created for each param to each call. The wrapper
      objects are later free'd by the GC. This patch could have a negative
      performance impact.
      54a11707
  5. Feb 18, 2015
  6. Feb 17, 2015
  7. Feb 14, 2015
  8. Mar 17, 2014
  9. Mar 16, 2014
  10. Mar 13, 2014
    • Lars Kanis's avatar
      Avoid warning: · 04c9e893
      Lars Kanis authored
      ../../../../ext/fox16_c/FXRbApp.cpp: In static member function ‘static FXRbApp* FXRbApp::constructAndInit(const FXchar*, const FXchar*)’:
      ../../../../ext/fox16_c/FXRbApp.cpp:58:28: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
         static char* argv[]={"",0};
                                  ^
      04c9e893
    • Lars Kanis's avatar
      Migrate to swig-2.0. · c29cd909
      Lars Kanis authored
      c29cd909
  11. Sep 28, 2013
    • Lars Kanis's avatar
      Manage GC'ing of FXTreeItem the same way as for FXFolderItem. · e36631d2
      Lars Kanis authored
      This fixes issue #10.
      
      Stacktrace was:
      ==4561== Invalid read of size 8
      ==4561==    at 0x4F726FF: st_lookup (st.c:414)
      ==4561==    by 0x4FCEAD6: rb_method_entry_get_without_cache (vm_method.c:182)
      ==4561==    by 0x4FD94E5: rb_funcall (vm_eval.c:315)
      ==4561==    by 0x810DAF2: FXRbCallVoidMethod(FX::FXObject*, unsigned long) (in /home/lars/.rvm/gems/ruby-2.0.0-p247/gems/fxruby-1.6.28/lib/fox16_c.so)
      ==4561==    by 0x81AC98E: FXRbTreeList::recalc() (in /home/lars/.rvm/gems/ruby-2.0.0-p247/gems/fxruby-1.6.28/lib/fox16_c.so)
      ==4561==    by 0x8FC78DC: FX::FXTreeList::removeItems(FX::FXTreeItem*, FX::FXTreeItem*, unsigned char) (FXTreeList.cpp:2340)
      ==4561==    by 0x8FC7916: FX::FXTreeList::removeItem(FX::FXTreeItem*, unsigned char) (FXTreeList.cpp:2347)
      ==4561==    by 0x829ED0F: FXRbTreeItem::freefunc(FX::FXTreeItem*) (in /home/lars/.rvm/gems/ruby-2.0.0-p247/gems/fxruby-1.6.28/lib/fox16_c.so)
      ==4561==    by 0x4EBA505: finalize_list (gc.c:1415)
      ==4561==    by 0x4EC15A3: rb_gc_call_finalizer_at_exit (gc.c:1552)
      ==4561==    by 0x4EA8064: ruby_cleanup (eval.c:127)
      ==4561==    by 0x4EA8292: ruby_run_node (eval.c:307)
      ==4561==  Address 0x74fb894853ff8550 is not stack'd, malloc'd or (recently) free'd
      ==4561==
      segfault_on_close.rb: [BUG] Segmentation fault
      e36631d2
  12. Jun 28, 2013
  13. Mar 31, 2013
  14. Feb 26, 2013
  15. Feb 15, 2013
  16. Jan 03, 2013
  17. Jun 16, 2012
    • Lars Kanis's avatar
      Fix Segfault in final GC when using FXSplashWindow. · baaf1384
      Lars Kanis authored
      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)
      baaf1384
  18. Jun 15, 2012
  19. Jun 01, 2012
  20. Mar 09, 2012
  21. Feb 16, 2012
    • Lars Kanis's avatar
      Change access to raw pixel data of FXImage and derivatives · 1646eeec
      Lars Kanis authored
      Allow more consistent read/write access to image data, that is also
      usable with derived classes like FXJPGImage.
      
      Moreover much faster String based access to the pixel data is possible,
      now.
      
      FXImage#data and FXMemoryBuffer is now deprecated.
      1646eeec
  22. Feb 13, 2012
  23. Feb 08, 2012
  24. Feb 07, 2012
    • Lars Kanis's avatar
    • Lars Kanis's avatar
      Fix Segfault while GC'ing FXWindows · a69d373e
      Lars Kanis authored
      FXWindow destructor calls recalc() and changeFocus() of it's parent windows.
      Since these methods are routed back to Ruby code, but calling Ruby code from
      GC isn't a good idea, we mark the parent window as "in_gc", so that it will
      ignore recalc() and changeFocus() calls completely.
      
      The parent window should also be scheduled to be free'd. In the other case,
      the child window would have been marked as used.
      a69d373e
  25. Feb 03, 2012
    • Lars Kanis's avatar
      Fix 'object allocation not allowed while garbage collection' bug · ac5d21d2
      Lars Kanis authored
      Calling any Ruby code within the mark phase is generelly dangerous,
      because it usually allocates some objects.
      Since most of the methods of FX objects can be overloaded in Ruby,
      the calls in markfuncs now call explizitly the C++ methods.
      
      Also remove some double marking of objects.
      ac5d21d2
  26. Feb 02, 2012
  27. Jan 31, 2012
  28. Jan 28, 2012
    • Lars Kanis's avatar
      Fix GC bug in FXAccelTable · eed1edad
      Lars Kanis authored
      The target objects stored in the accelerator table are currently
      private. Therefore FXRbAccelTable::markfunc() doesn't mark them as used.
      As a workaround the objects are additionally stored in @targets Hash.
      eed1edad
  29. Jan 25, 2012
  30. Oct 28, 2011
  31. Oct 08, 2011
Loading