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
2290 if ((*ppCtx)->pMemAlign != NULL) {2290 if ((*ppCtx)->pMemAlign != NULL) {
2291 WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_INFO, "FreeMemorySvc(), verify memory usage (%d bytes) after free..",2291 WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_INFO, "FreeMemorySvc(), verify memory usage (%d bytes) after free..",
2292 (*ppCtx)->pMemAlign->WelsGetMemoryUsage());2292 (*ppCtx)->pMemAlign->WelsGetMemoryUsage());
2293 delete (*ppCtx)->pMemAlign;2293 WELS_DELETE_OP((*ppCtx)->pMemAlign);
2294 (*ppCtx)->pMemAlign = NULL;
2295 }2294 }
2296 2295
2297 free (*ppCtx);2296 free (*ppCtx);
@@ -2479,8 +2478,7 @@ void WelsUninitEncoderExt (sWelsEncCtx** ppCtx) { · 181 unmodified lines
2479 2478
2480 if ((*ppCtx)->pVpp) {2479 if ((*ppCtx)->pVpp) {
2481 (*ppCtx)->pVpp->FreeSpatialPictures (*ppCtx);2480 (*ppCtx)->pVpp->FreeSpatialPictures (*ppCtx);
2482 delete (*ppCtx)->pVpp;2481 WELS_DELETE_OP((*ppCtx)->pVpp);
2483 (*ppCtx)->pVpp = NULL;
2484 }2482 }
2485 FreeMemorySvc (ppCtx);2483 FreeMemorySvc (ppCtx);
2486 *ppCtx = NULL;2484 *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