#6868 closed defect (fixed)
hErrorMutex leaks if GDALAllRegister is not called
Reported by: | Mateusz Łoskot | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | default | Version: | svn-trunk |
Severity: | major | Keywords: | memory, leak |
Cc: |
Description
This issue is of similar nature to #6139
Consider this minimal example:
int main() { CPLError(CE_None, CPLE_AppDefined, "Expected, CPLError called to trigger hErrorMutex allocation"); GDALDestroy(); return 0; }
If run under memory debugger, hErrorMutex
will be reported as memory and kernel resource leak.
The issue is due to:
CPLCleanupErrorMutex
only called fromGDALDriverManager
destructor- If
GDALAllRegister
is not called, there is noGDALDriverManager
instance to destroy and clean up the mutex
Solution: call CPLCleanupErrorMutex
from GDALDestroy
to ensure the clean-up
Attachments (2)
Change History (6)
by , 7 years ago
Attachment: | gdal-trunk-ticket-6868.patch added |
---|
by , 7 years ago
Attachment: | gdal-trunk-ticket-6868.2.patch added |
---|
Fix the reported issue. Update test.
Note:
See TracTickets
for help on using tickets.
Fix the reported issue. Update test. (Fixing tab to space)