File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1064,6 +1064,8 @@ class PCM_API PCM
10641064 bool isRDTDisabled () const ;
10651065
10661066public:
1067+ static bool isInitialized () { return instance != nullptr ; }
1068+
10671069 // ! check if TMA level 1 metrics are supported
10681070 bool isHWTMAL1Supported () const ;
10691071
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ void exit_cleanup(void)
3232 restore_signal_handlers ();
3333
3434 // this replaces same call in cleanup() from util.h
35- PCM::getInstance ()->cleanup (); // this replaces same call in cleanup() from util.h
35+ if ( PCM::isInitialized ()) PCM::getInstance ()->cleanup (); // this replaces same call in cleanup() from util.h
3636
3737// TODO: delete other shared objects.... if any.
3838
@@ -141,7 +141,7 @@ BOOL sigINT_handler(DWORD fdwCtrlType)
141141
142142 // in case PCM is blocked just return and summary will be dumped in
143143 // calling function, if needed
144- if (PCM::getInstance ()->isBlocked ()) {
144+ if (PCM::isInitialized () && PCM:: getInstance ()->isBlocked ()) {
145145 return FALSE ;
146146 } else {
147147 exit_cleanup ();
@@ -177,7 +177,7 @@ void sigINT_handler(int signum)
177177
178178 // in case PCM is blocked just return and summary will be dumped in
179179 // calling function, if needed
180- if (PCM::getInstance ()->isBlocked ()) {
180+ if (PCM::isInitialized () && PCM:: getInstance ()->isBlocked ()) {
181181 return ;
182182 } else {
183183 exit_cleanup ();
You can’t perform that action at this time.
0 commit comments