set released pointer to nullptr.
parent
df4294e6b8
commit
72d36140b3
|
@ -41,6 +41,12 @@ int main()
|
|||
delete fangdong3;
|
||||
delete jungle;
|
||||
delete jianmengtu;
|
||||
mediator = nullptr;
|
||||
fangdong1 = nullptr;
|
||||
fangdong2 = nullptr;
|
||||
fangdong3 = nullptr;
|
||||
jungle = nullptr;
|
||||
jianmengtu = nullptr;
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -43,6 +43,8 @@ int main()
|
|||
|
||||
delete Jungle;
|
||||
delete codeVer;
|
||||
Jungle = nullptr;
|
||||
codeVer = nullptr;
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -34,6 +34,11 @@ int main()
|
|||
delete Single;
|
||||
delete Jianmengtu;
|
||||
delete SillyDog;
|
||||
controller = nullptr;
|
||||
Jungle = nullptr;
|
||||
Single = nullptr;
|
||||
Jianmengtu = nullptr;
|
||||
SillyDog = nullptr;
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -14,6 +14,7 @@ int main()
|
|||
system("pause");
|
||||
|
||||
delete jungle;
|
||||
jungle = nullptr;
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -26,6 +26,7 @@ int main()
|
|||
system("pause");
|
||||
|
||||
delete ctx;
|
||||
ctx = nullptr;
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -6,14 +6,17 @@ int main()
|
|||
FingerprintModule *fp = new FingerprintModuleA();
|
||||
fp->algorithm();
|
||||
delete fp;
|
||||
fp = nullptr;
|
||||
|
||||
fp = new FingerprintModuleB();
|
||||
fp->algorithm();
|
||||
delete fp;
|
||||
fp = nullptr;
|
||||
|
||||
fp = new FingerprintModuleC();
|
||||
fp->algorithm();
|
||||
delete fp;
|
||||
fp = nullptr;
|
||||
|
||||
printf("\n\n");
|
||||
system("pause");
|
||||
|
|
|
@ -39,6 +39,13 @@ int main()
|
|||
delete cashier;
|
||||
delete jungle;
|
||||
delete shoppingCart;
|
||||
apple1 = nullptr;
|
||||
apple2 = nullptr;
|
||||
book1 = nullptr;
|
||||
book2 = nullptr;
|
||||
cashier = nullptr;
|
||||
jungle = nullptr;
|
||||
shoppingCart = nullptr;
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue