History

Merge pull request #2366 from sijchen/fix_free6

[Encoder] add error handling in memory allocation failed case for multi-threading

ruil2 committed 10 years ago

Commit 13586a32 parents f791ac2 e07ee9c4 files · +33 −17Browse files

Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 4 files). Show all

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+2−4
@@ -2290,8 +2290,7 @@ void FreeMemorySvc (sWelsEncCtx** ppCtx) { · 2289 unmodified lines
22902290 if ((*ppCtx)->pMemAlign != NULL) {
22912291 WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_INFO, "FreeMemorySvc(), verify memory usage (%d bytes) after free..",
22922292 (*ppCtx)->pMemAlign->WelsGetMemoryUsage());
2293− delete (*ppCtx)->pMemAlign;
2294− (*ppCtx)->pMemAlign = NULL;
2293+ WELS_DELETE_OP((*ppCtx)->pMemAlign);
22952294 }
22962295
22972296 free (*ppCtx);
@@ -2479,8 +2478,7 @@ void WelsUninitEncoderExt (sWelsEncCtx** ppCtx) { · 181 unmodified lines
24792478
24802479 if ((*ppCtx)->pVpp) {
24812480 (*ppCtx)->pVpp->FreeSpatialPictures (*ppCtx);
2482− delete (*ppCtx)->pVpp;
2483− (*ppCtx)->pVpp = NULL;
2481+ WELS_DELETE_OP((*ppCtx)->pVpp);
24842482 }
24852483 FreeMemorySvc (ppCtx);
24862484 *ppCtx = NULL;

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