Merged fix for random crash due to race condition with iup object not created/initialized