Changeset 13466
- Timestamp:
- 12/31/07 09:12:14 (6 months ago)
- Files:
-
- trunk/gdal/ogr/ogrsf_frmts/generic/ogrsfdriverregistrar.cpp (modified) (3 diffs)
- trunk/gdal/ogr/ogrsf_frmts/ogrsf_frmts.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/gdal/ogr/ogrsf_frmts/generic/ogrsfdriverregistrar.cpp
r12063 r13466 43 43 /* OGRSFDriverRegistrar */ 44 44 /************************************************************************/ 45 46 /** 47 * Constructor 48 * 49 * Normally the driver registrar is constucted by the 50 * OGRSFDriverRegistrar::GetRegistrar() accessor which ensures singleton 51 * status. 52 */ 45 53 46 54 OGRSFDriverRegistrar::OGRSFDriverRegistrar() … … 106 114 /************************************************************************/ 107 115 116 /** 117 * Cleanup all OGR related resources. 118 * 119 * This function will destroy the OGRSFDriverRegistrar along with all registered 120 * drivers, and then cleanup long lived OSR (OGRSpatialReference) and CPL 121 * resources. This may be called in an application when OGR services are 122 * no longer needed. It is not normally required, but by freeing all 123 * dynamically allocated memory it can make memory leak testing easier. 124 * 125 * In addition to destroying the OGRDriverRegistrar, this function also calls: 126 * - OSRCleanup() 127 * - CPLFinderClean() 128 * - VSICleanupFileManager() 129 * - CPLFreeConfig() 130 * - CPLCleanupTLS() 131 */ 108 132 void OGRCleanupAll() 109 133 110 134 { 111 CPLMutexHolderD( &hDRMutex ); 112 113 if( poRegistrar != NULL ) 114 delete poRegistrar; 115 OSRCleanup(); 135 { 136 // We don't want to hold the mutex while CPL level mutex services 137 // are being destroyed ... just long enough to avoid conflict while 138 // cleaning up OGR and OSR services. 139 CPLMutexHolderD( &hDRMutex ); 140 141 if( poRegistrar != NULL ) 142 delete poRegistrar; 143 OSRCleanup(); 144 } 145 116 146 CPLFinderClean(); 117 147 VSICleanupFileManager(); … … 124 154 /* GetRegistrar() */ 125 155 /************************************************************************/ 156 157 /** 158 * Fetch registrar. 159 * 160 * This static method should be used to fetch the singleton 161 * registrar. It will create a registrar if there is not already 162 * one in existance. 163 * 164 * @return the current driver registrar. 165 */ 126 166 127 167 OGRSFDriverRegistrar *OGRSFDriverRegistrar::GetRegistrar() trunk/gdal/ogr/ogrsf_frmts/ogrsf_frmts.h
r12731 r13466 255 255 256 256 /** 257 * Singleton manager for drivers. 258 * 257 * Singleton manager for OGRSFDriver instances that will be used to try 258 * and open datasources. Normally the registrar is populated with 259 * standard drivers using the OGRRegisterAll() function and does not need 260 * to be directly accessed. The driver registrar and all registered drivers 261 * may be cleaned up on shutdown using OGRCleanupAll(). 259 262 */ 260 263
