History

Remove unnecesary use of _SafeDelete

It is not necessary to check whether a pointer is NULL before deleting it, "delete NULL" is explicitly ok. The deleted pointer is a local variable here, so setting it to NULL after deleting isn't necessary in these cases either.

Martin Storsjö committed 12 years ago

Commit c5091e71 parent f8d5f932 files · +2 −2Browse files

Showing the changes to codec/processing/src (2 of 2 files). Show all

Unified · Split

2 files
  1. codec/processing/src/common/WelsFrameWork.cpp +1 −1
  2. codec/processing/src/common/WelsFrameWorkEx.cpp +1 −1
codec/processing/src/common/WelsFrameWork.cpp+1−1
@@ -79,7 +79,7 @@ EResult CreateSpecificVpInterface (IWelsVP** ppCtx) { · 78 unmodified lines
79}79}
80 80
81EResult DestroySpecificVpInterface (IWelsVP* pCtx) {81EResult DestroySpecificVpInterface (IWelsVP* pCtx) {
82 _SafeDelete (pCtx);82 delete pCtx;
83 83
84 return RET_SUCCESS;84 return RET_SUCCESS;
85}85}
codec/processing/src/common/WelsFrameWorkEx.cpp+1−1
@@ -87,7 +87,7 @@ EResult CreateSpecificVpInterface (IWelsVPc** pCtx) { · 86 unmodified lines
87EResult DestroySpecificVpInterface (IWelsVPc* pCtx) {87EResult DestroySpecificVpInterface (IWelsVPc* pCtx) {
88 if (pCtx) {88 if (pCtx) {
89 DestroySpecificVpInterface (WelsStaticCast (IWelsVP*, pCtx->pCtx));89 DestroySpecificVpInterface (WelsStaticCast (IWelsVP*, pCtx->pCtx));
90 _SafeDelete (pCtx);90 delete pCtx;
91 }91 }
92 92
93 return RET_SUCCESS;93 return RET_SUCCESS;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t