From 6414835fe7330ec168527f865273401ac52448e5 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Tue, 3 Jun 2008 13:10:49 +0000 Subject: [PATCH] 2008-06-03 15:10 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/vm/extrap.c ! fixed unregistering exception error handler in OS2 builds David, if possible please test. --- harbour/ChangeLog | 5 +++++ harbour/source/vm/extrap.c | 14 ++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index e12d46d1f0..085eb17314 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,11 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-06-03 15:10 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/vm/extrap.c + ! fixed unregistering exception error handler in OS2 builds + David, if possible please test. + 2008-06-03 10:12 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * source/vm/extend.c ! Reverted previous change. Caller should check the diff --git a/harbour/source/vm/extrap.c b/harbour/source/vm/extrap.c index 459b0ebd1f..a6a273c271 100644 --- a/harbour/source/vm/extrap.c +++ b/harbour/source/vm/extrap.c @@ -119,6 +119,8 @@ LONG WINAPI hb_win32ExceptionHandler( struct _EXCEPTION_POINTERS * ExceptionInfo #if defined(HB_OS_OS2) +static EXCEPTIONREGISTRATIONRECORD s_regRec; /* Exception Registration Record */ + ULONG _System hb_os2ExceptionHandler( PEXCEPTIONREPORTRECORD p1, PEXCEPTIONREGISTRATIONRECORD p2, PCONTEXTRECORD p3, @@ -157,12 +159,11 @@ void hb_vmSetExceptionHandler( void ) } #elif defined(HB_OS_OS2) /* Add OS2TermHandler to this thread's chain of exception handlers */ { - EXCEPTIONREGISTRATIONRECORD RegRec; /* Exception Registration Record */ APIRET rc; /* Return code */ - memset( &RegRec, 0, sizeof( RegRec ) ); - RegRec.ExceptionHandler = ( ERR ) hb_os2ExceptionHandler; - rc = DosSetExceptionHandler( &RegRec ); + memset( &s_regRec, 0, sizeof( s_regRec ) ); + s_regRec.ExceptionHandler = ( ERR ) hb_os2ExceptionHandler; + rc = DosSetExceptionHandler( &s_regRec ); if( rc != NO_ERROR ) hb_errInternal( HB_EI_ERRUNRECOV, "Unable to setup exception handler (DosSetExceptionHandler())", NULL, NULL ); } @@ -173,13 +174,10 @@ void hb_vmUnsetExceptionHandler( void ) { #if defined(HB_OS_OS2) /* Add OS2TermHandler to this thread's chain of exception handlers */ { - EXCEPTIONREGISTRATIONRECORD RegRec; /* Exception Registration Record */ APIRET rc; /* Return code */ - memset( &RegRec, 0, sizeof( RegRec ) ); - RegRec.ExceptionHandler = ( ERR ) hb_os2ExceptionHandler; /* I don't do any check on return code since harbour is exiting in any case */ - rc = DosUnsetExceptionHandler( &RegRec ); + rc = DosUnsetExceptionHandler( &s_regRec ); HB_SYMBOL_UNUSED( rc ); } #endif