Opened 10 years ago

Closed 9 years ago

#5303 closed defect (fixed)

[PATCH] Cleanup completeness in GDALDestroyDriverManager and OGRCleanupAll

Reported by: akhliustov Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description (last modified by akhliustov)

  1. In supplied global destruction functions GDALDestroy and DllMain GDALDestroyDriverManager is called before OGRCleanupAll.

The former calls a bunch of cleanup functions ending with CPLCleanupMasterMutex. Unfortunately, OGRCleanupAll immediately tries to get another mutex, recreating the master mutex.

  1. There is a possibility that CPLCleanupMasterMutex will not be called at all, if GDALDriverManager was not instantiated.

These issues can be fixed by adding required calls to OGRCleanupAll.

Attachments (1)

ogrcleanupall.patch (373 bytes ) - added by akhliustov 9 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by akhliustov, 10 years ago

Description: modified (diff)
Summary: Cleanup order in gcore/gdaldllmain.cppCleanup completeness in GDALDestroyDriverManager and OGRCleanupAll

comment:2 by Jukka Rahkonen, 9 years ago

Feels like a useful patch. Unfortunately core developers haven't had time to review it yet but thanks a lot anyway. This is the best place that GDAL project have for storing uncommitted patches so that at least the advanced users can find and utilize them.

comment:3 by Jukka Rahkonen, 9 years ago

Summary: Cleanup completeness in GDALDestroyDriverManager and OGRCleanupAll[PATCH] Cleanup completeness in GDALDestroyDriverManager and OGRCleanupAll

comment:4 by akhliustov, 9 years ago

Description: modified (diff)

comment:5 by akhliustov, 9 years ago

Well, GDAL 2 doesn't have this problem, and here is the patch for GDAL 1.11.

by akhliustov, 9 years ago

Attachment: ogrcleanupall.patch added

comment:6 by Even Rouault, 9 years ago

Resolution: fixed
Status: newclosed

If everything is fine in trunk, I'm not to keen in doing such a change in the stable branch, so closing

Note: See TracTickets for help on using tickets.