]> git.ipfire.org Git - thirdparty/asterisk.git/commit
loader: Ensure dependent modules are properly initialized.
authorJoshua Colp <jcolp@digium.com>
Thu, 27 Sep 2012 16:49:54 +0000 (16:49 +0000)
committerJoshua Colp <jcolp@digium.com>
Thu, 27 Sep 2012 16:49:54 +0000 (16:49 +0000)
commit6d3973330d07d95f278c8dbb55c3bd7ad2665b3c
treeca6137374bf90e327b4f733f0af9ffd68c093c21
parent2d421def0f989b25d64c262d58db8ce896cc2386
loader: Ensure dependent modules are properly initialized.

If an Asterisk module specifies a dependency in ast_module_info.nonoptreq, it
is possible for Asterisk to skip calling the modules's .load function.
Asterisk was loading and linking the module via load_dynamic_module() but was
not adding the module to the resource_heap. Therefore the module was not
initialized based on it's priority along with the other modules in the heap.

Now use load_resource() instead of load_dynamic_module() for non-optional
requirement. This will add the module to the resource_heap so the module can
be properly initialized in the correct order.

This is required if there are any module global data structures initialized in
the .load() callback for the module on platforms which do not support weak
references.

(issue ASTERISK-20439)
Reported by: sruffell
Patches:
     0001-loader-Ensure-dependent-modules-are-properly-initial.patch uploaded by sruffell (license 5417)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@373909 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/loader.c