SWT: no more handles error [message #230266] |
Thu, 08 February 2007 05:10 |
Eclipse User |
|
|
|
Originally posted by: neerajkarandikar.gmail.com
Hello everyone,
I am using GEF to create a sequence diagram editor. I have Graphicle Viewer
and Tree Viewer with flyoout palette, Overview Pane and Outline Page in my
editor. The problem i am facing is i get SWT.no more handles exception when
i repeatedly(three times) open a file having large no. of icons in it
(approximately 60). I have tried various options to dispose the images
during deactivate() call of all corresponding editParts. as follows:
Approach 1:
public void deactivate() {
if (isActive()) {
super.deactivate();
((ComplexTreeNode) getModel()).removePropertyChangeListener(this);
unregisterVisuals();
//REMOVE THE FIGURE OF THE MODEL
}
}
Approach 2:
public void deactivate() {
if (isActive()) {
super.deactivate();
((ComplexTreeNode) getModel()).removePropertyChangeListener(this);
getModel().getIcon().dispose();
// DISPOSE THE ICON USED BY THE MODEL
}
}
Still i get the same exception. Can anyone please help me solve this
problem.
Thanks,
-Neeraj
|
|
|
|
Re: SWT: no more handles error [message #230384 is a reply to message #230266] |
Fri, 09 February 2007 19:27 |
Eclipse User |
|
|
|
Originally posted by: irbull.cs.uvic.ca
Can you add some debug code to ensure that the icons are actually being
disposed?
cheers,
ian
neeraj wrote:
> Hello everyone,
>
> I am using GEF to create a sequence diagram editor. I have Graphicle Viewer
> and Tree Viewer with flyoout palette, Overview Pane and Outline Page in my
> editor. The problem i am facing is i get SWT.no more handles exception when
> i repeatedly(three times) open a file having large no. of icons in it
> (approximately 60). I have tried various options to dispose the images
> during deactivate() call of all corresponding editParts. as follows:
>
> Approach 1:
> public void deactivate() {
> if (isActive()) {
> super.deactivate();
> ((ComplexTreeNode) getModel()).removePropertyChangeListener(this);
> unregisterVisuals();
> //REMOVE THE FIGURE OF THE MODEL
> }
> }
>
> Approach 2:
> public void deactivate() {
> if (isActive()) {
> super.deactivate();
> ((ComplexTreeNode) getModel()).removePropertyChangeListener(this);
> getModel().getIcon().dispose();
> // DISPOSE THE ICON USED BY THE MODEL
> }
> }
>
> Still i get the same exception. Can anyone please help me solve this
> problem.
> Thanks,
> -Neeraj
>
>
|
|
|
Re: no more handles error [message #230405 is a reply to message #230266] |
Mon, 12 February 2007 06:44 |
Eclipse User |
|
|
|
Originally posted by: neerajkarandikar.gmail.com
Thanks Manuel and Ian for the reply. I have found a place in my code where i
create figures multiple times for similer icons. I'll try to remove that
part from code.
"neeraj" <neerajkarandikar@gmail.com> wrote in message
news:eqebd4$mt5$1@utils.eclipse.org...
> Hello everyone,
>
> I am using GEF to create a sequence diagram editor. I have Graphicle
> Viewer and Tree Viewer with flyoout palette, Overview Pane and Outline
> Page in my editor. The problem i am facing is i get SWT.no more handles
> exception when i repeatedly(three times) open a file having large no. of
> icons in it (approximately 60). I have tried various options to dispose
> the images during deactivate() call of all corresponding editParts. as
> follows:
>
> Approach 1:
> public void deactivate() {
> if (isActive()) {
> super.deactivate();
> ((ComplexTreeNode) getModel()).removePropertyChangeListener(this);
> unregisterVisuals(); //REMOVE THE FIGURE OF THE MODEL
> }
> }
>
> Approach 2:
> public void deactivate() {
> if (isActive()) {
> super.deactivate();
> ((ComplexTreeNode) getModel()).removePropertyChangeListener(this);
> getModel().getIcon().dispose(); // DISPOSE THE ICON USED BY THE MODEL
> }
> }
>
> Still i get the same exception. Can anyone please help me solve this
> problem.
> Thanks,
> -Neeraj
>
|
|
|
Re: no more handles error [message #230506 is a reply to message #230266] |
Tue, 13 February 2007 00:23 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
Does each of your model objects hold on to an image handle? You shouldn't
have it that way.
> getModel().getIcon().dispose();
"neeraj" <neerajkarandikar@gmail.com> wrote in message
news:eqebd4$mt5$1@utils.eclipse.org...
> Hello everyone,
>
> I am using GEF to create a sequence diagram editor. I have Graphicle
> Viewer and Tree Viewer with flyoout palette, Overview Pane and Outline
> Page in my editor. The problem i am facing is i get SWT.no more handles
> exception when i repeatedly(three times) open a file having large no. of
> icons in it (approximately 60). I have tried various options to dispose
> the images during deactivate() call of all corresponding editParts. as
> follows:
>
> Approach 1:
> public void deactivate() {
> if (isActive()) {
> super.deactivate();
> ((ComplexTreeNode) getModel()).removePropertyChangeListener(this);
> unregisterVisuals(); //REMOVE THE FIGURE OF THE MODEL
> }
> }
>
> Approach 2:
> public void deactivate() {
> if (isActive()) {
> super.deactivate();
> ((ComplexTreeNode) getModel()).removePropertyChangeListener(this);
> getModel().getIcon().dispose(); // DISPOSE THE ICON USED BY THE MODEL
> }
> }
>
> Still i get the same exception. Can anyone please help me solve this
> problem.
> Thanks,
> -Neeraj
>
|
|
|
Re: no more handles error [message #230560 is a reply to message #230506] |
Tue, 13 February 2007 09:32 |
Eclipse User |
|
|
|
Originally posted by: neerajkarandikar.gmail.com
Thanks Pratik,
I was infact making big mistake of not using imageregistry. I have it now.
And it works like a dream.
-Neeraj
"Pratik Shah" <none@unknown.com> wrote in message
news:eqr0d5$dtk$1@utils.eclipse.org...
> Does each of your model objects hold on to an image handle? You shouldn't
> have it that way.
>
>> getModel().getIcon().dispose();
>
> "neeraj" <neerajkarandikar@gmail.com> wrote in message
> news:eqebd4$mt5$1@utils.eclipse.org...
>> Hello everyone,
>>
>> I am using GEF to create a sequence diagram editor. I have Graphicle
>> Viewer and Tree Viewer with flyoout palette, Overview Pane and Outline
>> Page in my editor. The problem i am facing is i get SWT.no more handles
>> exception when i repeatedly(three times) open a file having large no. of
>> icons in it (approximately 60). I have tried various options to dispose
>> the images during deactivate() call of all corresponding editParts. as
>> follows:
>>
>> Approach 1:
>> public void deactivate() {
>> if (isActive()) {
>> super.deactivate();
>> ((ComplexTreeNode) getModel()).removePropertyChangeListener(this);
>> unregisterVisuals(); //REMOVE THE FIGURE OF THE MODEL
>> }
>> }
>>
>> Approach 2:
>> public void deactivate() {
>> if (isActive()) {
>> super.deactivate();
>> ((ComplexTreeNode) getModel()).removePropertyChangeListener(this);
>> getModel().getIcon().dispose(); // DISPOSE THE ICON USED BY THE MODEL
>> }
>> }
>>
>> Still i get the same exception. Can anyone please help me solve this
>> problem.
>> Thanks,
>> -Neeraj
>>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04003 seconds