DescriptionIssue #3391 - Initialize themed drawing variables using DetachedInitializer
Add static 'Initializer()' function to 'CPluginClass'. Also add static
detached initializer member to control execution of that function. Spawn an
initializer thread in the constructor. Add convenience method
EnsureInitialized() which simply forwards to the detached initializer.
Move declarations for themed drawing entry point variables into an anonymous
namespace. Move their initialization into 'Initializer()'. Convert
's_hUxtheme' into a local variable, since we no longer need to rely on its
value to guard against multiple execution. Similarly, remove now-unneeded
synchronization around these initializations, since that facility is now
provided by 'DetachedInitialization'.
Call EnsureInitialized() before using themed drawing variables. This
eliminates possible race conditions with using these variables before they
have had a chance to initialize.
Refactored the body of 'CloseTheme()' into that of its one calling function.
-----
This review depends upon another one.
https://codereview.adblockplus.org/29332660/
Patch Set 1 #
Total comments: 2
MessagesTotal messages: 2
|