Hey,
> 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 not sure if thats the real root of the issue. Either that remove from root 
should be needed for every window or for none. And as most of the windows work 
as expected during shutdown, there seems to be something different about your 
sub window which make this call necessary. That difference then should lead us 
to the root of the problem.


> I am only wondering why I didn't fell into something like this before.
> 
> Should 'qx.ui.window.Window' destructor maybe handle this?

I can't tell because I don't know why its not working as expected in your 
scenario. :(

> 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.

As long as we don't know the root of the issue, I can't tell if thats a good 
thing to add, sorry.

Regards,
Martin
------------------------------------------------------------------------------
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