Description
The pythonqt.dll crashes when you try to load it dynamically on Windows. The crash happens at this point:
PythonQt/src/PythonQtConversion.h
Line 166 in 503597b
The static function refers to a static variable that has complex type (QHash). The static variable is not initialised.
The issue is described here:
http://stackoverflow.com/questions/5114683/loading-dll-not-initializing-static-c-classes
Basically, complex typed static variables should be avoided in dll-s.
Pull request follows. I tried to get rid of every references to complex typed static variables. The object typed (non pointer) static data members I replaced by static getters that declare the variable as pointer, assignes NULL to it, and then does a NULL check and assigns a 'new' instance at the first time.
There were many static locals declared with type QByteArray but used only as const char * later. I changed the types to 'const char *' wherever I could.
In other cases the static locals were used only as performance tweak. There, I simply removed the 'static' keyword. All of them were trivial functions, the 'static' keyword was not necessary and I doubt that it made noticeable difference in execution time.