|
|
|
|
|
|
Re: memory leak in rap e4? [message #1741287 is a reply to message #1741262] |
Wed, 24 August 2016 11:31 |
Eclipse User |
|
|
|
Yes that is exactly that. When closing an MPart with the mouse, objects are destroyed (since RAP 3.1RC1 https://www.eclipse.org/forums/index.php/m/1731699/#msg_1731699).
But when closing the whole Context by closing your web navigator none of the objects are destroyed.
I didn't find a proper walkthrough for the moment because I still have difficulty to understand how Eclipse e4 works in term of application life cycle. And what kind of methods to inject for controlling the closing of the UISession.
I have been able to register the method "beforeDestroy()" and close all my objects one by one by setting them to a null or almost empty object.
public static void registerClosingUIsession(EPartService partService, EModelService modelService,Shell shell){
RWT.getUISession().addUISessionListener( new UISessionListener() {
public void beforeDestroy( UISessionEvent event ) {
for(MPart part : partService.getParts()){
**** Destroy objects of each MPart ****
arrayExample = new double[0][0]
}
}
}
}
At first I wanted to use beforeDestroy() to run :
partService.hidePart(part,true) to trigger the proper closing of each MPart, but it didn't work, it just hide the Part.
The best would be to trigger previous to beforeDestroy() the closing of each MPart with the same way as their are closed when one click on the "close" button.
|
|
|
|
Powered by
FUDForum. Page generated in 0.04674 seconds