<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>1111</bug_id>
          
          <creation_ts>2014-12-16 07:36:41 +0100</creation_ts>
          <short_desc>Java3D does not dispose correctly after use</short_desc>
          <delta_ts>2016-11-01 08:27:30 +0100</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>General</classification>
          <product>Java3D</product>
          <component>core</component>
          <version>unspecified</version>
          <rep_platform>pc_x86_64</rep_platform>
          <op_sys>windows</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter>iryan</reporter>
          <assigned_to name="Phil Jordan">p.j.nz</assigned_to>
          <cc>gouessej</cc>
    
    <cc>p.j.nz</cc>
          
          <cf_type>FEATURE</cf_type>
          <cf_scm_refs></cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>4488</commentid>
    <comment_count>0</comment_count>
    <who name="">iryan</who>
    <bug_when>2014-12-16 07:36:41 +0100</bug_when>
    <thetext>When using Java3D (version 1.6) without drawing anything onto the screen or setting anything to visible (for example to render an image into a file), the application will not exit. There simply seems to be no way to close Java3D without System.exiting the whole program.

Already tried to call finish on J3DThread (see  https://stackoverflow.com/questions/16470930/is-there-a-way-to-terminate-a-java-application-that-uses-java3d-without-calling ), which does not cause any errors - but also doesn&apos;t fix the problem, unfortunately. 

The problem can be reproduced simply with the old Java3D offscreen_canvas3D example (using the 1.6 libs and dependencies), by simply removing the call the JFrame.setVisible(true). The application starts, opens some windows (Java3D, I assume) for a short moment and then... does nothing but also doesn&apos;t exit.

The thread dump can be found here: http://pastebin.com/AK0gNs7D

The question would be, how to dipose the Java3D components manually to get back to the state the application was in before anything Java3D related was started.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4489</commentid>
    <comment_count>1</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2014-12-16 10:34:08 +0100</bug_when>
    <thetext>The problem is that the provided thread dump shows no thread created by Java3D except main-SharedResourceRunner, which comes from JOGL. Please try to dispose the Java3D canvas too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4501</commentid>
    <comment_count>2</comment_count>
    <who name="">iryan</who>
    <bug_when>2014-12-22 08:13:24 +0100</bug_when>
    <thetext>I tried setVisible(false), disable (deprecated) on the Canvas3D (since it has no dispose() method), but that doesn&apos;t change anything. There seem to be some potentially helpful sounding static methods, but as they aren&apos;t public...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4502</commentid>
    <comment_count>3</comment_count>
    <who name="Harvey Harrison">harvey.harrison</who>
    <bug_when>2014-12-22 08:26:35 +0100</bug_when>
    <thetext>Looking at that thread dump, the only non-daemon threads left are the AWT EventQueue threads, meaning there is some AWT component that hasn&apos;t been disposed....maybe fire up jvisualVM and look for leftover AWT windows?

Harvey</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5959</commentid>
    <comment_count>4</comment_count>
    <who name="Phil Jordan">p.j.nz</who>
    <bug_when>2016-10-18 07:34:55 +0200</bug_when>
    <thetext>https://java.net/projects/java3d/pages/Java3DApplicationDev
Has a section on this subject, that might be worth looking at</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5979</commentid>
    <comment_count>5</comment_count>
    <who name="Phil Jordan">p.j.nz</who>
    <bug_when>2016-11-01 08:27:30 +0100</bug_when>
    <thetext>Resolved in 1.7.0

All Java3D threads set to daemon

Note there is a strong possibility that this could have side effects particularly in headless environments.

However a daemon nature is more correct and will allow applications to exit gracefully and when expected.

In testing normal swing operations can cause non-exiting.
E.g. 
JFrame f = new JFrame();
f.pack();

will not exit unless 
f.dispose(); 
is called. This is unrelated to Java3D.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>