[Kde-bindings] rbuic problem ?

Richard Dale Richard_Dale at tipitina.demon.co.uk
Thu Oct 7 17:57:03 UTC 2004


On Thursday 07 October 2004 16:46, Thibauld Favre wrote:
> Hi,
>
> I just updated my local copy of qtruby and korundum and now I get errors
> and my app crashes whereas it was doing fine before the update. Here's what
> is printed on stderr when I launch my app :
> ------------------------------------------------
> thibs at simbad:~/dev/tableau_bord$ ./Main.rb
> ./ClientsDlgUi.rb:264: warning: method redefined; discarding old nextClient
> ./ClientsDlgUi.rb:268: warning: method redefined; discarding old
> previousClient
> ./ClientsDlgUi.rb:272: warning: method redefined; discarding old
> modifyClient ./ClientsDlgUi.rb:280: warning: method redefined; discarding
> old printClients ./RessourcesDlgUi.rb:499: warning: method redefined;
> discarding old modifyCommercial
> ./RessourcesDlgUi.rb:503: warning: method redefined; discarding old
> nextCommercial
> ./RessourcesDlgUi.rb:507: warning: method redefined; discarding old
> previousCommercial
> ./RessourcesDlgUi.rb:519: warning: method redefined; discarding old
> modifyTechnicien
> ./RessourcesDlgUi.rb:527: warning: method redefined; discarding old
> nextTechnicien
> ./RessourcesDlgUi.rb:531: warning: method redefined; discarding old
> previousTechnicien
> ./IncidentsDlgUi.rb:296: warning: method redefined; discarding old
> modifyIncident
> ./IncidentsDlgUi.rb:300: warning: method redefined; discarding old
> nextIncident
> ./IncidentsDlgUi.rb:304: warning: method redefined; discarding old
> previousIncident
> ./ContratsDlgUi.rb:836: warning: method redefined; discarding old nextExp
> ./ContratsDlgUi.rb:840: warning: method redefined; discarding old nextSup
> ./ContratsDlgUi.rb:844: warning: method redefined; discarding old nextProd
> ./ContratsDlgUi.rb:848: warning: method redefined; discarding old
> previousExp ./ContratsDlgUi.rb:852: warning: method redefined; discarding
> old previousSup ./ContratsDlgUi.rb:856: warning: method redefined;
> discarding old previousProd ./ContratsDlgUi.rb:860: warning: method
> redefined; discarding old printSup ./ContratsDlgUi.rb:884: warning: method
> redefined; discarding old modifyExp ./ContratsDlgUi.rb:888: warning: method
> redefined; discarding old modifySup ./ContratsDlgUi.rb:892: warning: method
> redefined; discarding old modifyProd ./ContratsDlgUi.rb:908: warning:
> method redefined; discarding old printExp ./ContratsDlgUi.rb:912: warning:
> method redefined; discarding old printProd KCrash: Application 'Main.rb'
> crashing...
> thibs at simbad:~/dev/tableau_bord$
> ----------------------------------------
>
> You can also notice the final crash when I quit the application. Here's the
> backtrace :
> --------------------------------------
> Using host libthread_db library "/lib/tls/libthread_db.so.1".
> [Thread debugging using libthread_db enabled]
> [New Thread 1076401248 (LWP 12057)]
> [KCrash handler]
> #3  0x00000000 in ?? ()
> #4  0x41c5095b in KApplication::~KApplication () from
> /usr/lib/libkdecore.so.4 #5  0x4087d9df in x_KApplication::~x_KApplication
> ()
>    from /usr/lib/libsmokekde.so.1
> #6  0x4084c9c3 in xcall_KApplication () from /usr/lib/libsmokekde.so.1
> #7  0x402e34c5 in dispose ()
>    from /usr/local/lib/site_ruby/1.8/i386-linux/korundum.so
> #8  0x40060dfe in rb_throw () from /usr/lib/libruby1.8.so.1.8
> #9  0x400538f5 in rb_with_disable_interrupt () from
> /usr/lib/libruby1.8.so.1.8 #10 0x42ba9fd8 in ?? ()
> #11 0x00000000 in ?? ()
> #12 0x00000000 in ?? ()
> #13 0x00000000 in ?? ()
> #14 0x42b97900 in ?? ()
> #15 0x40294e18 in ?? ()
> #16 0x00000000 in ?? ()
> #17 0x42ba9fd8 in ?? ()
> #18 0x42baa258 in ?? ()
> #19 0x400ebed8 in ruby_in_eval () from /usr/lib/libruby1.8.so.1.8
> #20 0x400db760 in ?? () from /usr/lib/libruby1.8.so.1.8
> #21 0x40295444 in ?? ()
> #22 0x40067deb in rb_gc_force_recycle () from /usr/lib/libruby1.8.so.1.8
> ---------------------------------------------------
>
> Also, I'm not sure that generating *by default* attr_reader attribute
> accessors for rbuic generated class is a good idea. attr_reader is useful
> for certain things but it should not be generated automatically as it
> basically breaks the encapsulation paradigm of OOP.
> If I want some of my instances variables to be reachable outside my class,
> I can do it myself by specifying exactly which ones I want to be
> accessible. I don't know what the majority is thinking but I'm really for
> removing this feature. Or maybe just put it as an rbuic option, something
> like
> "--make-variables-visible" as I must admit it can be useful sometimes if
> you design it like this and don't want to have to manually add an
> attr_reader for each of your instance variables.
Yes, I get the warning messages too for your tableau_bord example. But I 
didn't for the Color Tool app example. I'll have to look into what the 
difference is. I'm not sure about your problems with attr_reader because the 
whole point of it is that it means you don't access the instance variable 
directly and an accessor method is generated automatically.

I thought I'd improved the KApplication exit behaviour, but it looks like it 
got worse - oh well.. It doesn't happen for me though.

-- Richard



More information about the Kde-bindings mailing list