Consultor Eletrônico



Kbase P173042: Unhandled exception when closing ABL Window with a WAIT-FOR which was launched from the procedure ed
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/1/2010
Status: Unverified

SYMPTOM(s):

Unhandled exception when closing ABL Window with a WAIT-FOR which was launched from the procedure editor

When closing a Window which was started with its own WAIT-FOR, in the midst of a .NETUI/ABL application, once the WAIT-FOR is satisfied an Unhandled exception is thrown.

WndProc override causes exception and hang

Hang when overriding WndProc

Attempt to use an object that has explicitly been deleted. (15580)
Object name: WndProc

Attempt to use an object that has explicitly been deleted. (15580)
Object name: OnFormClosing

.NET Exception text:

System.ObjectDisposedException: Attempt to use an object that has been explicitly been deleted. (15580)
Object Name: 'OnFormclosing'.
at Progress.ClrBridge.BrgClrToPro.InvokeMethod(Int32 , Int32 , String , Int32 , Object[] , Int32[] , Type[] , Object )
at sys.AgilityWindowBase.OnFormClosing(FormClosingEventArgs ) in AblProxy.cs:line 53
at System.Windows.Forms.Form.WmClose(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at Progress.Windows.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

FACT(s) (Environment):

Windows
OpenEdge 10.2B
OpenEdge Category: Language (4GL/ABL)

CAUSE:

Bug# OE00200265

CAUSE:

This is partially expected behavior. The error message (Attempt to use an object that has been explicitly deleted) is quite accurate in this case, however the associated hang may not be.

The problem is that, by nature, the procedure editor creates a list of persistent procedures and classes that are running before running a procedure so that after the procedure is finished running it can ensure that all objects created by the launched procedure are cleaned up. After running the procedure, the procedure editor code goes through a list of the session procedures and objects and checks them against the ones it had in memory prior to running the procedure and deletes them.

After closing the procedure, when the user goes back to the form which had been deleted by the procedure editor code, the WndProc event handler attempts to fire on an object which no longer exists and gives the error shown above.

FIX:

Firstly, be very careful when using stacked WAIT-FORs. You must make sure, with absolute certainty, that windows are closed in the order by which they were opened and all objects that are sitting on the WAIT-FOR are cleaned up properly

Secondly, If you want to provide an interface for running code while your .NETUI application is already running, make sure that the call is modal so that no users can interact with the .NETUI side of the application while the ABL code is executing from the procedure editor or... Write your own procedure editor which doesn't perform the same cleanup tasks indescriminately.