set released pointer to nullptr.

master
FengJungle 2022-03-09 23:09:06 +08:00
parent d2e449a0af
commit df4294e6b8
3 changed files with 26 additions and 0 deletions

View File

@ -56,5 +56,18 @@ int main()
delete office7; delete office7;
delete office8; delete office8;
head = nullptr;
sichuanBranch = nullptr;
cdBranch = nullptr;
myBranch = nullptr;
office1 = nullptr;
office2 = nullptr;
office3 = nullptr;
office4 = nullptr;
office5 = nullptr;
office6 = nullptr;
office7 = nullptr;
office8 = nullptr;
return 0; return 0;
} }

View File

@ -35,6 +35,11 @@ int main()
delete device2; delete device2;
delete device3; delete device3;
delete device4; delete device4;
factory = nullptr;
device1 = nullptr;
device2 = nullptr;
device3 = nullptr;
device4 = nullptr;
system("pause"); system("pause");
return 0; return 0;

View File

@ -37,6 +37,14 @@ int main()
delete bill2; delete bill2;
delete bill3; delete bill3;
delete bill4; delete bill4;
zuzhang = nullptr;
bingge = nullptr;
chunzong = nullptr;
laoban = nullptr;
bill1 = nullptr;
bill2 = nullptr;
bill3 = nullptr;
bill4 = nullptr;
system("pause"); system("pause");
return 0; return 0;