In a simple Java class (attached) the "finalize routine is only called if
1. The object reference is set to null before program exit AND
2. The mainline code sleeps for a few seconds before exiting
also .. if these conditions are met, but if the constructor fails, later on, the finalize routine is STILL called!! (See example in attachment)
ron.kleinman@Eng 1997-02-25
1. The object reference is set to null before program exit AND
2. The mainline code sleeps for a few seconds before exiting
also .. if these conditions are met, but if the constructor fails, later on, the finalize routine is STILL called!! (See example in attachment)
ron.kleinman@Eng 1997-02-25
- duplicates
-
JDK-4111593 class finalizer called on unconstructed object
- Closed