Bitrh, life and death of an instance of a class

Posted by OctavioOlguin on 04-Mar-2017 13:30

/* ***************************  Main Block  *************************** */

/* Set CURRENT-WINDOW: this will parent dialog-boxes and frames.        */
ASSIGN CURRENT-WINDOW                = {&WINDOW-NAME} 
       THIS-PROCEDURE:CURRENT-WINDOW = {&WINDOW-NAME}.

/* The CLOSE event can be used from inside or outside the procedure to  */
/* terminate it.                                                        */
ON CLOSE OF THIS-PROCEDURE 
    DO:
        DELETE OBJECT oFingerPrint. 
        RUN disable_UI.
    END.
/* Best default for GUI applications is...                              */
PAUSE 0 BEFORE-HIDE.

/* Now enable the interface and wait for the exit condition.            */
/* (NOTE: handle ERROR and END-KEY so cleanup code will always fire.    */
MAIN-BLOCK:
DO ON ERROR   UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK
    ON END-KEY UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK:
        
    oFingerPrint = NEW BioLogin ( ) .
        
    RUN enable_UI.
   
    
    IF NOT THIS-PROCEDURE:PERSISTENT THEN
        WAIT-FOR CLOSE OF THIS-PROCEDURE.
END.

If you pay attention, this is (part of) the basic construct of a .W with a sligth modification on the ON CLOSE trigger.

I'm using the answer from [mention:43713cf888d84bdcb3637e465ffa1de6:e9ed411860ed4f2ba0265705b8793d05] to community.progress.com/.../30139, to look under the hood...and found this:

[17/03/04@13:16:25.249-0600] P-022988 T-027640 2 4GL 4GLTRACE Run procs\Nom\Nom07001.w [USER-INTERFACE-TRIGGER - procs\men\sch_virt.w @ 870]
[17/03/04@13:16:25.254-0600] P-022988 T-027640 2 4GL 4GLTRACE New procs.Bio.BioLogin [Main Block - procs\Nom\Nom07001.w @ 477]
[17/03/04@13:16:25.254-0600] P-022988 T-027640 2 4GL 4GLTRACE Invoke InitializeComponent [BioLogin - procs.Bio.BioLogin @ 86]
[17/03/04@13:16:25.261-0600] P-022988 T-027640 3 4GL 4GLTRACE Return from InitializeComponent [procs.Bio.BioLogin]
[17/03/04@13:16:25.261-0600] P-022988 T-027640 2 4GL 4GLTRACE Invoke InicializaScanner [BioLogin - procs.Bio.BioLogin @ 88]
[17/03/04@13:16:26.287-0600] P-022988 T-027640 3 4GL 4GLTRACE Return from InicializaScanner [procs.Bio.BioLogin]
[17/03/04@13:16:26.287-0600] P-022988 T-027640 3 4GL 4GLTRACE Return from BioLogin [procs.Bio.BioLogin]
[17/03/04@13:16:26.287-0600] P-022988 T-027640 2 4GL 4GLTRACE Run enable_UI [Main Block - procs\Nom\Nom07001.w @ 479]
[17/03/04@13:16:26.306-0600] P-022988 T-027640 3 4GL 4GLTRACE Return from enable_UI [procs\Nom\Nom07001.w]
[17/03/04@13:16:26.306-0600] P-022988 T-027640 2 4GL 4GLTRACE Run CargaDatos [Main Block - procs\Nom\Nom07001.w @ 481]
[17/03/04@13:16:26.313-0600] P-022988 T-027640 3 4GL 4GLTRACE Return from CargaDatos [procs\Nom\Nom07001.w]
[17/03/04@13:16:29.879-0600] P-022988 T-027640 2 4GL 4GLTRACE Delete BioLogin [USER-INTERFACE-TRIGGER - procs\Nom\Nom07001.w @ 465]
[17/03/04@13:16:29.971-0600] P-022988 T-027640 1 4GL -- (Procedure: 'BioLogin procs.Bio.BioLogin' Line:567) Se dió un valor de "handle" inválido o inapropiado para la sentencia DELETE OBJECT o DELETE PROCEDURE. (5425)
[17/03/04@13:16:29.971-0600] P-022988 T-027640 3 4GL 4GLTRACE Return from BioLogin [procs.Bio.BioLogin]
[17/03/04@13:16:29.971-0600] P-022988 T-027640 2 4GL 4GLTRACE Run disable_UI [USER-INTERFACE-TRIGGER - procs\Nom\Nom07001.w @ 466]
[17/03/04@13:16:29.984-0600] P-022988 T-027640 3 4GL 4GLTRACE Return from disable_UI [procs\Nom\Nom07001.w]
[17/03/04@13:16:29.984-0600] P-022988 T-027640 3 4GL 4GLTRACE Return from Main Block [procs\Nom\Nom07001.w]

when I call the uib window that creates NEW BiolLogin(). and just close it....

I'm worried about (5425), as this program hangs randomly after 2 consecutive runs....

Posted by Frank Meulblok on 06-Mar-2017 05:42

"I'm worried about (5425) ..."

Then you need to look at the class' destructor. That's where the error happens, so that's where you have the reference to an invalid handle.

All Replies

Posted by Frank Meulblok on 06-Mar-2017 05:42

"I'm worried about (5425) ..."

Then you need to look at the class' destructor. That's where the error happens, so that's where you have the reference to an invalid handle.

This thread is closed