Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » commands never disposed
commands never disposed [message #60652] Wed, 11 October 2006 11:50 Go to next message
Eclipse UserFriend
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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I have =
several=20
custom commands specific to my application.&nbsp; The dispose method on =
these=20
methods is never called.&nbsp; 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&nbsp;all the commands including =
the custom=20
commands I had created.&nbsp; 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.&nbsp; </FONT></P>
<P><FONT face=3DArial size=3D2>There is a memory leak because the =
commands are not=20
disposed.&nbsp; 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>&nbsp;</P>
<P><FONT face=3DArial size=3D2></FONT>&nbsp;</P>
<P><FONT face=3DArial size=3D2></FONT>&nbsp;</P>
<P><FONT face=3DArial size=3D2></FONT>&nbsp;</P>
<P><FONT face=3DArial size=3D2></FONT>&nbsp;</P><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;</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 Go to previous messageGo to next message
Linda Damus is currently offline Linda DamusFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Linda Damus is currently offline Linda DamusFriend
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
>>>
>>>
>
>
Previous Topic:- getMapMode() has private in WrapLabel???
Next Topic:extracting
Goto Forum:
  


Current Time: Sat Jul 27 16:29:13 GMT 2024

Powered by FUDForum. Page generated in 0.03477 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top