Changeset 80
- Timestamp:
- Apr 6, 2006, 9:32:24 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel/qfont.cpp
r8 r80 2933 2933 const uint QFontCache::min_cost = 4*1024; // 4mb 2934 2934 2935 #if defined (Q_OS_OS2) 2936 2937 // On OS/2, destructors of static objects in a DLL cannot use objects created 2938 // on the stack of the main thread when the application is being abnormally 2939 // terminated (exit(), DosExit(), DosKillProcess(), etc), because at a time when 2940 // these static destructors are called (from _DLL_InitTerm on most compilers, 2941 // including GCC and IBM VAC) the stack is most likely reused by the DLL 2942 // termination code. Since QFontCache is a child of QApplication (which is 2943 // usually created as a local object inside the main() function) and wants to 2944 // use its parent during destruction, this becomes a real problem and causes a 2945 // guaranteed application trap during abnormal termination. The workaround is to 2946 // use atexit() instead. Note that this will only work for the exit() case 2947 // (on DosExit() or DosKillProcess(), the stdlib's exit list is not processed). 2948 2949 static void cleanupFontCache() 2950 { 2951 if (QFontCache::instance != 0) 2952 delete QFontCache::instance; 2953 } 2954 2955 #else 2935 2956 static QSingleCleanupHandler<QFontCache> cleanup_fontcache; 2936 2957 #endif 2937 2958 2938 2959 QFontCache::QFontCache() … … 2942 2963 Q_ASSERT( instance == 0 ); 2943 2964 instance = this; 2965 #if defined (Q_OS_OS2) 2966 atexit( cleanupFontCache ); 2967 #else 2944 2968 cleanup_fontcache.set( &instance ); 2969 #endif 2945 2970 } 2946 2971
Note:
See TracChangeset
for help on using the changeset viewer.