Re: [qooxdoo-devel] Disposing Commands in menu destructor

2014-01-16 Thread Mustafa Sak
Hi Alexey,

I'm wrong, you are totally right. As I could see now, destroying / disposing an 
instance of LayoutItem will destroy / dispose all children widgets.

And you are also right to ask, why the command property of buttons are not 
reset on destruction. Please open a BUG for this issue.

Gruß
Mustafa Sak

Applications & Integration

1&1 Internet AG
Ernst-Frey-Straße 10
DE-76135 Karlsruhe


-Ursprüngliche Nachricht-
Von: alexey.zakharenkov [mailto:[email protected]] 
Gesendet: Donnerstag, 16. Januar 2014 10:31
An: [email protected]
Betreff: Re: [qooxdoo-devel] Disposing Commands in menu destructor

Mustafa Sak-5 wrote
> In qooxdoo only "child" widgets managed by "child control" pattern [1] 
> will be automatically disposed if parent widget is disposing.

Menu buttons are disposed on menu disposal, it's a matter of fact and it's 
quite reasonable. One can be certain of that by inheriting a custom class from 
qx.ui.menu.Button where redefined destructor prints out a log message: 
http://tinyurl.com/nhoy6fm <http://tinyurl.com/nhoy6fm>  

or by inspecting the code of "add" method of qx.ui.menu.Menu to make sure that 
the menu.Buttons are managed by the Menu parent widget similarly to those which 
are added through the "child control pattern", at least in what relates memory 
management.


What about my question *"why menuButton doesn't unbind a coupled Command on
destruction?"* I see the root of my problem in this place as yet.






--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Disposing-Commands-in-menu-destructor-tp7585184p7585191.html
Sent from the qooxdoo mailing list archive at Nabble.com.

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical 
Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] Disposing Commands in menu destructor

2014-01-16 Thread alexey.zakharenkov
Mustafa Sak-5 wrote
> In qooxdoo only "child" widgets managed by "child control" pattern [1]
> will be automatically disposed if parent widget is disposing.

Menu buttons are disposed on menu disposal, it's a matter of fact and it's
quite reasonable. One can be certain of that by inheriting a custom class
from qx.ui.menu.Button where redefined destructor prints out a log message: 
http://tinyurl.com/nhoy6fm   

or by inspecting the code of "add" method of qx.ui.menu.Menu to make sure
that the menu.Buttons are managed by the Menu parent widget similarly to
those which are added through the "child control pattern", at least in what
relates memory management.


What about my question *"why menuButton doesn't unbind a coupled Command on
destruction?"* I see the root of my problem in this place as yet.






--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Disposing-Commands-in-menu-destructor-tp7585184p7585191.html
Sent from the qooxdoo mailing list archive at Nabble.com.

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] Disposing Commands in menu destructor

2014-01-15 Thread Mustafa Sak
Hi Alexey,

In qooxdoo only "child" widgets managed by "child control" pattern [1] will be 
automatically disposed if parent widget is disposing.

Gruß
Mustafa Sak

[1] 
http://manual.qooxdoo.org/devel/pages/desktop/ui_develop.html?highlight=child%20control#child-controls

Applications & Integration

1&1 Internet AG
Ernst-Frey-Straße 10
DE-76135 Karlsruhe

-Ursprüngliche Nachricht-
Von: alexey_zakh [mailto:[email protected]] 
Gesendet: Mittwoch, 15. Januar 2014 15:47
An: [email protected]
Betreff: Re: [qooxdoo-devel] Disposing Commands in menu destructor

Mustafa, thanks for your answer.

But why should I dispose menu buttons if they are disposed automatically as 
children widgets?
If the problem is in subwidgets and commands disposal order, how should I 
organize the Menu class to accurately dispose all the created commands? But 
before developing this direction of thoughts...

A want to ask developers: why menuButton doesn't unbound a coupled Command on 
destruction? As deep as I managed to dig out, my problem arise from the fact 
that in the destructor of the menuButton (actually, MExecutable mixin) there is 
no this.setCommand(null); but only this._applyCommand(null, this.getCommand());

When I replace the latter operator with the former one, my error dissappears. I 
dare to assume that the problem is that after
MExecutable.destruct() a situation comes when _applyCommand(null, ...) is 
called but the property "command" is still not null.





--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Disposing-Commands-in-menu-destructor-tp7585184p7585187.html
Sent from the qooxdoo mailing list archive at Nabble.com.

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical 
Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] Disposing Commands in menu destructor

2014-01-15 Thread alexey_zakh
Mustafa, thanks for your answer.

But why should I dispose menu buttons if they are disposed automatically as
children widgets?
If the problem is in subwidgets and commands disposal order, how should I
organize the Menu class to accurately dispose all the created commands? But
before developing this direction of thoughts...

A want to ask developers: why menuButton doesn't unbound a coupled Command
on destruction? As deep as I managed to dig out, my problem arise from the
fact that in the destructor of the menuButton (actually, MExecutable mixin)
there is no
this.setCommand(null);
but only
this._applyCommand(null, this.getCommand());

When I replace the latter operator with the former one, my error
dissappears. I dare to assume that the problem is that after
MExecutable.destruct() a situation comes when _applyCommand(null, ...) is
called but the property "command" is still not null.





--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Disposing-Commands-in-menu-destructor-tp7585184p7585187.html
Sent from the qooxdoo mailing list archive at Nabble.com.

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] Disposing Commands in menu destructor

2014-01-15 Thread Mustafa Sak
Hi Alexey,

you should try to dispose the menu buttons before. There are still references 
to the command instance.

Gruß
Mustafa Sak

Applications & Integration

1&1 Internet AG
Ernst-Frey-Straße 10
DE-76135 Karlsruhe

-Ursprüngliche Nachricht-
Von: alexey_zakh [mailto:[email protected]] 
Gesendet: Mittwoch, 15. Januar 2014 14:56
An: [email protected]
Betreff: [qooxdoo-devel] Disposing Commands in menu destructor

My question is: is the application corrent:
http://tinyurl.com/oju4mtc   (full code below)
 
Specifically, is the construction and disposal of the _actions array correct? I 
suppose it is reasonable to destruct Commands in the menu destructor if i'm 
sure that they are referenced only from the menu. Are there errors in my 
reasoning? 

This code gives an error when built with qx.debug.dispose.level = 2 (Qooxdoo 
version 3.0.1), and if it's conceptually correct, it seems there exists a
bug(s) in Qooxdoo that prevents the desposer-debug tool to do its work 
properly. I'll provide other necessary information on the problem if needed.

==
// Full code:

qx.Class.define("app.Menu", {
extend: qx.ui.menu.Menu,
  
construct: function() {
this.base(arguments);

this._actions = [];
},

destruct: function() {
qx.log.Logger.debug("~Menu()");
this._disposeArray("_actions");
},

members: {  
_actions: null,

createAction: function(label) {
var action = new qx.ui.core.Command();
this._actions.push(action);
var menuButton = new qx.ui.menu.Button(label, null, 
action);
this.add(menuButton);
return action;
}
}

});

qx.Class.define("app.Application", {
extend : qx.application.Standalone,

members : {

main : function() {
this.base(arguments);

var menu = new app.Menu();
menu.createAction('action-1');
menu.createAction('action-2');
  
var root = this.getRoot();
var button = new qx.ui.form.Button("Dispose menu");
root.setContextMenu(menu);
button.addListener("execute", function() {
root.setContextMenu(null);
menu.dispose();
});

this.getRoot().add(button);  
}
}
});




--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Disposing-Commands-in-menu-destructor-tp7585184.html
Sent from the qooxdoo mailing list archive at Nabble.com.

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical 
Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel