Ignore:
Timestamp:
Oct 18, 2006, 11:58:35 PM (19 years ago)
Author:
dmik
Message:

Kernel: Added the Qt-wide OS/2 system exception handler (see ticket:33 for details). It may be disabled by defining QT_PM_NO_SYSEXCEPTIONS when building Qt.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel/qthread_pm.cpp

    r125 r136  
    3939
    4040#include "qt_os2.h"
     41
     42#if !defined(QT_PM_NO_SYSEXCEPTIONS)
     43extern // defined in qsysxcpt_pm.cpp
     44ULONG APIENTRY qt_exceptionHandler( PEXCEPTIONREPORTRECORD pReportRec,
     45                                    PEXCEPTIONREGISTRATIONRECORD pRegRec,
     46                                    PCONTEXTRECORD pContextRec,
     47                                    PVOID pv );
     48extern ERR qt_libcExceptionHandler; // defined in qapplication_pm.cpp
     49#endif
    4150
    4251#include "qthread.h"
     
    106115    LocalStorage = arg [1];
    107116
     117#if !defined(QT_PM_NO_SYSEXCEPTIONS)
     118    // don't set the exception handler if not able to do it for main thread
     119    bool setException = qt_libcExceptionHandler != NULL;
     120    EXCEPTIONREGISTRATIONRECORD excRegRec = { 0, qt_exceptionHandler };
     121    if ( setException )
     122        DosSetExceptionHandler( &excRegRec );
     123#endif
     124
    108125    ( (QThread *) arg[0] )->run();
    109126
    110127    finish( (QThreadInstance *) arg[1] );
    111128
     129#if !defined(QT_PM_NO_SYSEXCEPTIONS)
     130    if ( setException )
     131        DosUnsetExceptionHandler( &excRegRec );
     132#endif
     133   
    112134    return;
    113135}
Note: See TracChangeset for help on using the changeset viewer.