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