viktorthang / mgwt

Automatically exported from code.google.com/p/mgwt
Other
0 stars 0 forks source link

memory leak in ScrollPanelTouchImpl (need unbindResizeEvent() on detach) #253

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In our application we use some animation for some "details section", that the 
old section "moves out" from screen, and the new one "moves into" screen, so 
each time when new details section is shown new instance of ui is created. When 
to many reloads of that section occurs the memory usage slowly (but noticeably) 
increases. As i find out the problem was in OrientationChangeHandler in 
ScrollPanelTouchImpl that is subscribed on attach but not unsubscribed on 
detach.

    @Override
    protected void onUnload() {
        unbindResizeEvent();
        super.onUnload();
    }

- completely resolves this problem. But to apply this fix locally i had to 
copy-paste whole ScrollPanelTouchImpl in some place in over project, and 
redirect ScrollPanelImpl on it in our .gwt.xml ...

Can you please fix it in proper place (in your code) :)

mgwt in use: mgwt-1.1.1.jar

Original issue reported on code.google.com by IO.Bak...@gmail.com on 8 Oct 2012 at 4:02

GoogleCodeExporter commented 8 years ago
Actually ScrollPanelTouchImpl overwrites OnDeattach and contains the exact same 
code you are mentioning. So this is rather strange. Take a look at the 
implementation of ScrollPanelTouchImpls deattach method and let me know how 
this is any different from what you are suggesting. (ondeattach calls onUnLoad 
in widget)

Original comment by kurka.da...@gmail.com on 8 Oct 2012 at 6:06

GoogleCodeExporter commented 8 years ago

Original comment by kurka.da...@gmail.com on 8 Oct 2012 at 6:06

GoogleCodeExporter commented 8 years ago
Thank you for your answer, and Yes, you are right, i take a look at
http://code.google.com/p/mgwt/source/browse/src/main/java/com/googlecode/mgwt/ui
/client/widget/impl/ScrollPanelTouchImpl.java
and can see code you mentioned, but unfortunately it is it is absent in 
mgwt-1.1.1.jar that we obtain from maven. (the same thing with mgwt-1.1.1.jar 
from Downloads section).

In our pom.xml we have

        <dependency>
            <groupId>com.googlecode.mgwt</groupId>
            <artifactId>mgwt</artifactId>
            <version>1.1.1</version>
            <scope>provided</scope>
        </dependency>

Can we obtain some latest assembles (with that fix included) through the maven ?

Original comment by IO.Bak...@gmail.com on 9 Oct 2012 at 11:34

GoogleCodeExporter commented 8 years ago
here you can find the docs on how to use mgwt snapshots: 
http://code.google.com/p/mgwt/wiki/Snapshots

Original comment by kurka.da...@gmail.com on 9 Oct 2012 at 11:43

GoogleCodeExporter commented 8 years ago

Original comment by kurka.da...@gmail.com on 20 Oct 2012 at 4:01

GoogleCodeExporter commented 8 years ago

Original comment by kurka.da...@gmail.com on 20 Oct 2012 at 4:11