| 175 | } |
| 176 | |
| 177 | int |
| 178 | msPluginLayerInitializeVirtualTable(layerObj *layer) |
| 179 | { |
| 180 | VTFactoryItemObj *pVTFI; |
| 181 | |
| 182 | msAcquireLock(TLOCK_LAYER_VTABLE); |
| 183 | |
| 184 | pVTFI = lookupVTFItem(&gVirtualTableFactory, layer->plugin_library); |
| 185 | if ( ! pVTFI) { |
| 186 | pVTFI = loadCustomLayerDLL(layer, layer->plugin_library); |
| 187 | if ( ! pVTFI) { |
| 188 | msReleaseLock(TLOCK_LAYER_VTABLE); |
| 189 | return MS_FAILURE; |
| 190 | } |
| 191 | if (insertNewVTFItem(&gVirtualTableFactory, pVTFI) != MS_SUCCESS) { |
| 192 | destroyVTFItem(&pVTFI); |
| 193 | msReleaseLock(TLOCK_LAYER_VTABLE); |
| 194 | return MS_FAILURE; |
| 195 | } |
| 196 | } |
| 197 | msReleaseLock(TLOCK_LAYER_VTABLE); |
| 198 | |
| 199 | copyVirtualTable(layer->vtable, &pVTFI->vtable); |
| 200 | return MS_SUCCESS; |
| 201 | } |
| 202 | |
| 203 | /* msPluginFreeVirtualTableFactory() |
| 204 | ** Called by msCleanup() to free the virtual table factory |
no test coverage detected