This fixes the wxRED Mac link error. Thanks to Nick for pointing out that I hadn''t removed some wxRED code related to an earlier experiment. Hopefully this one will build on Mac, end-to-end. I also found and fixed a problem that was causing the crash on exit: wxWindows automatically deletes the C++ app object as soon as the last frame is closed. Later, when ruby garbage collected the ruby Wx::App object, it was trying to delete the C++ app (again). Thud. The solution was to prevent wxWindows from deleting the app object. It keeps a global pointer (wxTheApp) around, so I just zeroed it out before getting to the code that does the delete. There is a chance that this might have problems on other platforms, IF any platform-specific wxWindows makes some bad assumptions. After I fixed that, I started seeing a different crash. That one was easy to fix, because I had already written the code to avoid it. I was waiting for a test case to prove it was really needed. So that one is fixed, too. Unfortunately, we''re still crashing on exit, for some other unknown reason. Bah. I''ll work on it more this weekend. Kevin
I can''t find this -- I only see version up to 12. Did you forget to post it? Curt> -----Original Message----- > From: wxruby-users-bounces@rubyforge.org > [mailto:wxruby-users-bounces@rubyforge.org]On Behalf Of Kevin Smith > Sent: Saturday, May 01, 2004 3:17 AM > To: Wxruby users list > Subject: [Wxruby-users] wxruby-swig 0.0.13 is up > > > This fixes the wxRED Mac link error. Thanks to Nick for pointing out > that I hadn''t removed some wxRED code related to an earlier experiment. > Hopefully this one will build on Mac, end-to-end. > > I also found and fixed a problem that was causing the crash on exit: > wxWindows automatically deletes the C++ app object as soon as the last > frame is closed. Later, when ruby garbage collected the ruby Wx::App > object, it was trying to delete the C++ app (again). Thud. > > The solution was to prevent wxWindows from deleting the app object. It > keeps a global pointer (wxTheApp) around, so I just zeroed it out before > getting to the code that does the delete. There is a chance that this > might have problems on other platforms, IF any platform-specific > wxWindows makes some bad assumptions. > > After I fixed that, I started seeing a different crash. That one was > easy to fix, because I had already written the code to avoid it. I was > waiting for a test case to prove it was really needed. So that one is > fixed, too. > > Unfortunately, we''re still crashing on exit, for some other unknown > reason. Bah. I''ll work on it more this weekend. > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users
Curt Hibbs wrote:> I can''t find this -- I only see version up to 12. Did you forget to post it?Oops! I really need to automate the release process. 0.0.13 is really up there now. Sorry, and thanks for letting me know. Kevin
On 2004 May 2, at 2:20, Kevin Smith wrote:> 0.0.13 is really up there now.Here''s the Mac report: [ryan@kursk 08:50:00 ~]$ cd Desktop/wxruby-swig-0.0.13 [ryan@kursk 08:50:06 ~/Desktop/wxruby-swig-0.0.13]$ rake ...all good... g++ -c -I/usr/local/lib/wx/include/mac-2.4 -D__WXMAC__ -DWXMAKINGDLL -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -fno-common -fno-common -pipe -fno-common -x objective-c++ -I /usr/local/lib/ruby/gems/1.8/rake-0.3.1/lib -I /usr/local/lib/ruby/site_ruby/1.8 -I /usr/local/lib/ruby/site_ruby/1.8/powerpc-darwin -I /usr/local/lib/ruby/site_ruby -I /usr/local/lib/ruby/1.8 -I /usr/local/lib/ruby/1.8/powerpc-darwin -I . -o obj/MenuBar.o src/MenuBar.cpp src/MenuBar.cpp: In function `VALUE _wrap_wxMenuBar_FindMenu(int, VALUE*, long unsigned int)'': src/MenuBar.cpp:912: warning: passing `const wxMenuBar'' as `this'' argument of ` int wxMenuBar::FindMenu(const wxString&)'' discards qualifiers ...all good... [ryan@kursk 08:55:47 ~/Desktop/wxruby-swig-0.0.13]$ ls LICENSE TODO obj/ rakefile src/ wxruby.prj README lib/ rake/ samples/ swig/ wxruby.pws [ryan@kursk 08:56:03 ~/Desktop/wxruby-swig-0.0.13]$ cd samples/ [ryan@kursk 08:56:09 ~/Desktop/wxruby-swig-0.0.13/samples]$ ls calendar/ etc/ minimal/ test.rb [ryan@kursk 08:56:10 ~/Desktop/wxruby-swig-0.0.13/samples]$ ruby -I../lib test.rb Defined XXX = 777 Calling main_loop OnInitGui before OnInitGui after on_init ...mouse over and close the window... on_exit Returned from main_loop test.rb:66: [BUG] Segmentation fault ruby 1.8.1 (2003-12-25) [powerpc-darwin] Abort trap [ryan@kursk 08:56:33 ~/Desktop/wxruby-swig-0.0.13/samples]$ Then I made an app bundle around minimal.rb, opened it, and quit from the menu bar. Apple''s crash reporter comes up with: Date/Time: 2004-05-03 09:02:14 -0500 OS Version: 10.3.3 (Build 7F44) Report Version: 2 Command: ruby Path: /usr/local/bin/ruby Version: ??? (???) PID: 8444 Thread: 0 Exception: EXC_BAD_ACCESS (0x0001) Codes: KERN_INVALID_ADDRESS (0x0001) at 0x207c0800 Thread 0 Crashed: 0 <<00000000>> 0x207c0800 0 + 0x207c0800 1 libruby.dylib 0x001d4784 rb_gc_call_finalizer_at_exit + 0x198 (gc.c:1800) 2 libruby.dylib 0x001b6bc4 ruby_finalize_1 + 0x28 (eval.c:1380) 3 libruby.dylib 0x001b6d38 ruby_cleanup + 0x120 (eval.c:1417) 4 libruby.dylib 0x001b6ea8 ruby_stop + 0x10 (eval.c:1447) 5 libruby.dylib 0x001b6f0c compile_error + 0 (eval.c:1465) 6 ruby 0x00001d84 0x1000 + 0xd84 7 ruby 0x00001a84 _start + 0x188 (crt.c:267) 8 ruby 0x000018f8 start + 0x30 -- Ryan "John" Platte Custom services, NIKA Consulting http://nikaconsulting.com/
John Platte wrote:> Here''s the Mac report: > > src/MenuBar.cpp: In function `VALUE _wrap_wxMenuBar_FindMenu(int, > VALUE*, long > unsigned int)'': > src/MenuBar.cpp:912: warning: passing `const wxMenuBar'' as `this'' > argument of ` > int wxMenuBar::FindMenu(const wxString&)'' discards qualifiersYup. I haven''t figured out how to prevent this warning yet.> ...mouse over and close the window... > on_exit > Returned from main_loop > test.rb:66: [BUG] Segmentation fault > ruby 1.8.1 (2003-12-25) [powerpc-darwin]Yup. This is the known double-delete problem that I am working on. It seems that the Mac version is working exactly as well as the Linux version now, which is great news. Many thanks to you and Nick for helping debug and solve the rakefile issues! Kevin