MantisBT - JANA
View Issue Details
0000271JANABugpublic2012-07-12 10:102012-08-15 15:59
davidl 
davidl 
normalminoralways
resolvedfixed 
0000271: Factories from plugins not given priority
Contrary to the advertised functionality, factories added via plugins are not used in preference to ones statically compiled into an executable. The apparent behavior is:

Run() ->
DApplication::Init() ->
AttachPlugins()

The factory generator in DANA is created and added in the DApplication constructor. Any created in a plugin are added later through the above calling sequence. The factory generators are called in order so any coming from plugins are called last. Therefore, factories from plugins are added to the bottom of the list for each JEventLoop.

To fix this, one would need to do the following in AttachPlugins:
- make a temporary copy of the factory generator pointers
- clear the list of factory generator pointers
- call InitPlugin for all plugins
- append the list of factory generator pointers from the temporary copy

This would also mean the factories from generators have priority in the order that the plugins are specified.
No tags attached.
Issue History
2012-07-12 10:10davidlNew Issue
2012-08-15 15:59davidlNote Added: 0000427
2012-08-15 15:59davidlStatusnew => resolved
2012-08-15 15:59davidlResolutionopen => fixed
2012-08-15 15:59davidlAssigned To => davidl

Notes
(0000427)
davidl   
2012-08-15 15:59   
The change was implemented as described in the issue description. Testing was tedious though since it turns out that using the same name for the factory generator class in the plugin as was used in the executable caused the GenerateFactories() method of the statically linked class to be used. This effectively makes two sets of statically linked factories and no sets of the plugin factories.