Home » Modeling » GMF (Graphical Modeling Framework) » commands never disposed
commands never disposed [message #60652] |
Wed, 11 October 2006 11:50 |
Eclipse User |
|
|
|
Originally posted by: ayesha.ltp.soft.net
This is a multi-part message in MIME format.
------=_NextPart_000_0010_01C6ED59.90E31030
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi All,
I have several custom commands specific to my application. The =
dispose method on these methods is never called. When I investigated, I =
found that=20
getOperationHistory().getUndoHistory(getUndoContext())=20
returned all the commands including the custom commands I had created. =
Disposing the IUndoableOperation did not dispose the command itself, but =
disposed only the context of the CompositeCommand.
However, with GEF, CompositeCommand invokes each of the Command's =
dispose to dispose off the objects. =20
There is a memory leak because the commands are not disposed. Also, =
there is no way to retrieve the actual command from the =
CompositeCommand.
How can I fix this problem?
--Ayesha
------=_NextPart_000_0010_01C6ED59.90E31030
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hi All,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> I have =
several=20
custom commands specific to my application. The dispose method on =
these=20
methods is never called. When I investigated, I found that </FONT>
<P><FONT face=3DArial size=3D2><FONT=20
face=3DCourier>getOperationHistory().getUndoHistory(getUndoContext()) </FO=
NT>=20
</FONT></P>
<P><FONT face=3DArial size=3D2>returned all the commands including =
the custom=20
commands I had created. Disposing the IUndoableOperation did not =
dispose=20
the command itself, but disposed only the context of the=20
CompositeCommand.</FONT></P>
<P><FONT face=3DArial size=3D2>However, with GEF, CompositeCommand =
invokes each of=20
the Command's dispose to dispose off the objects. </FONT></P>
<P><FONT face=3DArial size=3D2>There is a memory leak because the =
commands are not=20
disposed. Also, there is no way to retrieve the actual command =
from the=20
CompositeCommand.</FONT></P>
<P><FONT face=3DArial size=3D2>How can I fix this problem?</FONT></P>
<P><FONT face=3DArial size=3D2>--Ayesha</FONT></P>
<P><FONT face=3DArial size=3D2></FONT> </P>
<P><FONT face=3DArial size=3D2></FONT> </P>
<P><FONT face=3DArial size=3D2></FONT> </P>
<P><FONT face=3DArial size=3D2></FONT> </P>
<P><FONT face=3DArial size=3D2></FONT> </P><FONT face=3DArial=20
size=3D2> </FONT></DIV></BODY ></HTML>
------=_NextPart_000_0010_01C6ED59.90E31030--
|
|
|
Re: commands never disposed [message #60657 is a reply to message #60652] |
Wed, 11 October 2006 14:16 |
Linda Damus Messages: 85 Registered: July 2009 |
Member |
|
|
Hello Ayesha,
Which commands are not being disposed? GMF's CompositeCommand#dispose
calls #dispose on each of its children, so if your commands are in a
composite, your #dispose implementation should be called.
You can iterate over the children of a CompositeCommand by asking for
its #iterator() or #listIterator().
Regards,
Linda
ayesha@ltp.soft.net wrote:
> Hi All,
> I have several custom commands specific to my application. The
> dispose method on these methods is never called. When I investigated, I
> found that
>
> getOperationHistory().getUndoHistory(getUndoContext())
>
> returned all the commands including the custom commands I had created.
> Disposing the IUndoableOperation did not dispose the command itself, but
> disposed only the context of the CompositeCommand.
>
> However, with GEF, CompositeCommand invokes each of the Command's
> dispose to dispose off the objects.
>
> There is a memory leak because the commands are not disposed. Also,
> there is no way to retrieve the actual command from the CompositeCommand.
>
> How can I fix this problem?
>
> --Ayesha
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
Re: commands never disposed [message #61262 is a reply to message #60657] |
Thu, 12 October 2006 08:56 |
Eclipse User |
|
|
|
Originally posted by: ayesha.ltp.soft.net
Hi Linda,
Yes, That works. Thanks. However, CompositeCommand.dispose() is not
invoking dispose on the commands I created although the commands are in the
composite.
I am using GMF version 1.0.0.v20060627-1200
Ayesha
"Linda Damus" <ldamus@ca.ibm.com> wrote in message
news:egiucr$98q$1@utils.eclipse.org...
> Hello Ayesha,
>
> Which commands are not being disposed? GMF's CompositeCommand#dispose
> calls #dispose on each of its children, so if your commands are in a
> composite, your #dispose implementation should be called.
>
> You can iterate over the children of a CompositeCommand by asking for its
> #iterator() or #listIterator().
>
> Regards,
> Linda
>
>
> ayesha@ltp.soft.net wrote:
>> Hi All,
>> I have several custom commands specific to my application. The
>> dispose method on these methods is never called. When I investigated, I
>> found that
>>
>> getOperationHistory().getUndoHistory(getUndoContext())
>>
>> returned all the commands including the custom commands I had created.
>> Disposing the IUndoableOperation did not dispose the command itself, but
>> disposed only the context of the CompositeCommand.
>>
>> However, with GEF, CompositeCommand invokes each of the Command's dispose
>> to dispose off the objects. There is a memory leak because the commands
>> are not disposed. Also, there is no way to retrieve the actual command
>> from the CompositeCommand.
>>
>> How can I fix this problem?
>>
>> --Ayesha
>>
>>
|
|
|
Re: commands never disposed [message #61749 is a reply to message #61262] |
Thu, 12 October 2006 14:30 |
Linda Damus Messages: 85 Registered: July 2009 |
Member |
|
|
That's strange, because that version of CompositeCommand has an
implementation of dispose that disposes its children, as far as I can
tell. Can you verify? Are you sure the CompositeCommand it itself being
disposed? Are your commands directly contained in the CompositeCommand,
or are there other kinds of commands nested in between?
--Linda
ayesha@ltp.soft.net wrote:
> Hi Linda,
> Yes, That works. Thanks. However, CompositeCommand.dispose() is not
> invoking dispose on the commands I created although the commands are in the
> composite.
> I am using GMF version 1.0.0.v20060627-1200
>
> Ayesha
>
> "Linda Damus" <ldamus@ca.ibm.com> wrote in message
> news:egiucr$98q$1@utils.eclipse.org...
>> Hello Ayesha,
>>
>> Which commands are not being disposed? GMF's CompositeCommand#dispose
>> calls #dispose on each of its children, so if your commands are in a
>> composite, your #dispose implementation should be called.
>>
>> You can iterate over the children of a CompositeCommand by asking for its
>> #iterator() or #listIterator().
>>
>> Regards,
>> Linda
>>
>>
>> ayesha@ltp.soft.net wrote:
>>> Hi All,
>>> I have several custom commands specific to my application. The
>>> dispose method on these methods is never called. When I investigated, I
>>> found that
>>>
>>> getOperationHistory().getUndoHistory(getUndoContext())
>>>
>>> returned all the commands including the custom commands I had created.
>>> Disposing the IUndoableOperation did not dispose the command itself, but
>>> disposed only the context of the CompositeCommand.
>>>
>>> However, with GEF, CompositeCommand invokes each of the Command's dispose
>>> to dispose off the objects. There is a memory leak because the commands
>>> are not disposed. Also, there is no way to retrieve the actual command
>>> from the CompositeCommand.
>>>
>>> How can I fix this problem?
>>>
>>> --Ayesha
>>>
>>>
>
>
|
|
|
Goto Forum:
Current Time: Fri Nov 08 22:19:01 GMT 2024
Powered by FUDForum. Page generated in 0.03051 seconds
|