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.
Showing the changes to codec/processing/src/common (2 of 2 files). Show all
Unified · Split
| @@ -79,7 +79,7 @@ EResult CreateSpecificVpInterface (IWelsVP** ppCtx) { · 78 unmodified lines | ||
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | EResult DestroySpecificVpInterface (IWelsVP* pCtx) { |
| 82 | − _SafeDelete (pCtx); | |
| 82 | + delete pCtx; | |
| 83 | 83 | |
| 84 | 84 | return RET_SUCCESS; |
| 85 | 85 | } |
| @@ -87,7 +87,7 @@ EResult CreateSpecificVpInterface (IWelsVPc** pCtx) { · 86 unmodified lines | ||
| 87 | 87 | EResult DestroySpecificVpInterface (IWelsVPc* pCtx) { |
| 88 | 88 | if (pCtx) { |
| 89 | 89 | DestroySpecificVpInterface (WelsStaticCast (IWelsVP*, pCtx->pCtx)); |
| 90 | − _SafeDelete (pCtx); | |
| 90 | + delete pCtx; | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | return RET_SUCCESS; |