diff options
Diffstat (limited to 'srclib/apr-util/hooks')
-rw-r--r-- | srclib/apr-util/hooks/apr_hooks.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/srclib/apr-util/hooks/apr_hooks.c b/srclib/apr-util/hooks/apr_hooks.c index 44353cbb..6abe1935 100644 --- a/srclib/apr-util/hooks/apr_hooks.c +++ b/srclib/apr-util/hooks/apr_hooks.c @@ -243,6 +243,10 @@ APU_DECLARE(void) apr_hook_sort_all(void) #endif int n; + if (!s_aHooksToSort) { + s_aHooksToSort = apr_array_make(apr_hook_global_pool, 1, sizeof(HookSortEntry)); + } + for(n=0 ; n < s_aHooksToSort->nelts ; ++n) { HookSortEntry *pEntry=&((HookSortEntry *)s_aHooksToSort->elts)[n]; *pEntry->paHooks=sort_hook(*pEntry->paHooks,pEntry->szHookName); @@ -261,6 +265,10 @@ APU_DECLARE(void) apr_hook_deregister_all(void) #endif int n; + if (!s_aHooksToSort) { + return; + } + for(n=0 ; n < s_aHooksToSort->nelts ; ++n) { HookSortEntry *pEntry=&((HookSortEntry *)s_aHooksToSort->elts)[n]; *pEntry->paHooks=NULL; |