Changeset 103532 in vbox for trunk/src/VBox/Main/include
- Timestamp:
- Feb 22, 2024 2:05:31 PM (11 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/AutoStateDep.h
r98263 r103532 73 73 mRegistered(FALSE) 74 74 { 75 Assert(aThat);76 mRC = aThat->i_addStateDependency(taDepType, &mMachineState,77 &mRegistered);75 if (RT_VALID_PTR(aThat)) 76 mRC = aThat->i_addStateDependency(taDepType, &mMachineState, 77 &mRegistered); 78 78 } 79 79 ~AutoStateDependency() 80 80 { 81 if ( SUCCEEDED(mRC))81 if (RT_VALID_PTR(mThat) && SUCCEEDED(mRC)) 82 82 mThat->i_releaseStateDependency(); 83 83 } … … 88 88 { 89 89 AssertReturnVoid(SUCCEEDED(mRC)); 90 mThat->i_releaseStateDependency(); 90 if (RT_VALID_PTR(mThat)) 91 mThat->i_releaseStateDependency(); 91 92 mRC = E_FAIL; 92 93 } … … 98 99 { 99 100 AssertReturnVoid(!SUCCEEDED(mRC)); 100 mRC = mThat->i_addStateDependency(taDepType, &mMachineState, 101 &mRegistered); 101 if (RT_VALID_PTR(mThat)) 102 mRC = mThat->i_addStateDependency(taDepType, &mMachineState, 103 &mRegistered); 104 else 105 mRC = S_OK; 102 106 } 103 107
Note:
See TracChangeset
for help on using the changeset viewer.