Package com.sun.star.uno

Examples of com.sun.star.uno.WeakReference


        boolean[] r= new boolean[50];
        int i= 0;

        WeakBase aObj1= new WeakBase();
//        WeakBase aObj2= new WeakBase();
        WeakReference wr1= new WeakReference(aObj1);
        WeakReference wr2= new WeakReference(wr1);
       
        r[i++]= wr1.get() == aObj1;
        r[i++]= wr2.get() == aObj1;
        aObj1= null;
       
          //        Object obj= ref.get();
        System.out.println("Wait 5 sec");
        for(int c= 0; c < 50; c++)
        {
            try
            {
                Thread.currentThread().sleep(100);
                System.gc();
                System.runFinalization();
            }catch (InterruptedException ie)
            {
            }
        }
        r[i++]= wr1.get() == null;
        r[i++]= wr2.get() == null;
   
        boolean bOk= true;
        for (int c= 0; c < i; c++)
            bOk= bOk && r[c];
        if (bOk == false)
View Full Code Here

TOP

Related Classes of com.sun.star.uno.WeakReference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.