Example usage for com.google.gwt.dev.shell.designtime JsValue mainThreadCleanup

List of usage examples for com.google.gwt.dev.shell.designtime JsValue mainThreadCleanup

Introduction

In this page you can find the example usage for com.google.gwt.dev.shell.designtime JsValue mainThreadCleanup.

Prototype

public static void mainThreadCleanup() 

Source Link

Document

The main thread should call this from time to time to release hosted-mode objects that Java is no longer referencing.

Usage

From source file:com.google.gdt.eclipse.designer.ie.BrowserShellIE.java

License:Open Source License

@Override
public void dispose() {
    m_shell.dispose();/*  w  w  w.  j a  v a  2  s .c o  m*/
    try {
        ModuleSpace space = getModuleSpace();
        if (space != null) {
            space.dispose();
        }
    } catch (Throwable e) {
        ReflectionUtils.propagate(e);
    }
    System.gc();
    System.runFinalization();
    JsValue.mainThreadCleanup();
    super.dispose();
}

From source file:com.google.gdt.eclipse.designer.ie.jsni.ModuleSpaceIE.java

License:Open Source License

@Override
public void dispose() throws Exception {
    for (NativeFunctionInfo function : m_nativeFunctions.values()) {
        function.dispose();//from   w ww. j  av a  2 s .  co m
    }
    // Dispose everything else.
    if (window != null) {
        window.dispose();
    }
    super.dispose();
    IDispatchProxy.clearIDispatchProxyRefs(getIsolatedClassLoader());
    for (int i = 0; i < 2; i++) {
        if (!GWTEnvironmentUtils.DEVELOPERS_HOST) {
            System.gc();
        }
        System.runFinalization();
        JsValue.mainThreadCleanup();
    }
}

From source file:com.google.gdt.eclipse.designer.moz.BrowserShellLinux.java

License:Open Source License

@Override
public void dispose() {
    // force disposing any pending JsValue instances
    JsValue.mainThreadCleanup();
    System.runFinalization();/* w  w  w  .  jav  a2s .c  o m*/
    System.gc();
    System.runFinalization();
    System.gc();
    try {
        ModuleSpace space = getModuleSpace();
        if (space != null) {
            space.dispose();
        }
    } catch (Throwable e) {
        ReflectionUtils.propagate(e);
    }
    m_shell.dispose();
    super.dispose();
}

From source file:com.google.gdt.eclipse.designer.webkit.BrowserShellWebKit.java

License:Open Source License

@Override
public void dispose() {
    // force disposing any pending JsValue instances
    JsValue.mainThreadCleanup();
    try {// w w w  . j  a v  a2s . co m
        ModuleSpace space = getModuleSpace();
        if (space != null) {
            space.dispose();
        }
    } catch (Throwable e) {
        ReflectionUtils.propagate(e);
    }
    super.dispose();
    impl.dispose();
}