Hello again,

> Hi,
>> Is there a thing I can do to see whether this might be the case? I also only
>> can guess what's happening. But as I have several 10th of windows and dialogs
>> and this issue came up just recently, I am pretty sure the wrong usage is "on
>> my side".
> 
> Well, maybe its in your code. But it might also be that you did something new 
> but totally ok in your code which triggered the framework bug. You can never 
> know. :)

I think I found the reason! It seems to be on "my end" (...of course ;) )

The SubWindow Class (derived from qx.ui.window.Window) basically looked
something like this:
-----------------------
<code>
qx.Class.define("foo.ui.SubWindow",
{
  extend : qx.ui.window.Window,

  construct : function () {
    this.base(arguments);
    // create some visual stuff
  }
});
</code>
-----------------------

In my Window class, an instance of SubWindow is created, and shown:

-----------------------
<code>
  members  :
  {
    // Button event handler
    __onButtonExecute : function (e)
    {
      var type = e.getTarget().getUserData("type");
      var subWin = this.__getSubWindow(type);
      if (subWin) {
        subWin.open();
      }
    },

    __getSubWindow : function (type)
    {
      // 'type' dependencies removed for clarity...

      if (!this.__subWindow) { // kind of 'singleton per Window'
        this.__subWindow = new foo.ui.SubWindow();
      }
      return this.__subWindow;
    }
  },

  destruct : function () {
    this._disposeObjects("__subWindow");
  }
</code>
-----------------------

The destructor of Window is called during my 'cleanup', that was --as noted
previously-- O.K. so far.

What seemed to be the problem was, that I did not _remove_ the SubWindow from
its parent! Because I did not (actively) _add_ it to any parent I wasn't
thinking about that.


So when I alter SubWindow by adding a destructor:
-----------------------
<code>
qx.Class.define("foo.ui.SubWindow",
{
  extend : qx.ui.window.Window,

  construct : function () {
    this.base(arguments);
    // create some stuff
  },

  destruct : function ()
  {
    // We have been added to 'root' somewhere at construction or during..
    // .. open() / show() so we have to remove ourselves from it.
    var root = qx.core.Init.getApplication().getRoot();
    root.remove(this);
  }
});
</code>
-----------------------

... it seems to be O.K.! Hooray!


I am only wondering why I didn't fell into something like this before.

Should 'qx.ui.window.Window' destructor maybe handle this?



>> Can someone (you?) tell a little more when I try to post a stack dump?
> We can give it a try! Or check yourself if you have  flush call in the 
> stacktrace which could be a hint.
> 
> 
>> Right! This is only a last resort. A message that might point me to the root
>> cause would be better. Something like:
>> ---------------------------------
>> 991: if !(content) {
>> 992:   this.warn("'content' is not valid! Did you possibly do this or 
>> that?");
>> 993: }
>> 994: if (Object.keys(contentStyles).length > 0) {
>> 995:   content.setStyles(contentStyles);
>> 996: }
>> ---------------------------------
>> But for that, we first need to know what went wrong ;)
> 
> Exactly. :)

I'm not sure if "my" reason is the only possible, but in that case something
like this might help:
---------------------------------
989: if !(content) {
990:   this.warn("'content' is not valid! " +
991:             "Check if widget might not have been removed from parent. " +
992:             "Missing <code>parent.remove(this);</code> in destructor?");
993: }
---------------------------------
But this might be way too specific.


>> I'm not sure I can. My Application is pretty large and not in the public
>> domain. But maybe I can find the time at the weekend to re-create the issue
>> with a basic application.
> That would be perfect.
> 
> Regards,
> Martin

Thanks again for the offered help,
  Peter


-- 

*************************************************************
Besuchen Sie uns:
01.-03.10.2013 Post-Expo in Wien
Wir laden Sie herzlich ein und freuen uns auf Ihre Anmeldung.
*************************************************************

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to