71
Help / Re: code::blocks hangs at startup
« Last post by Miguel Gimenez on January 22, 2026, 04:34:43 pm »Quote
not sure if really usable
It is very helpful indeed.
IMHO the problem is wxSmith uses global objects to register items:
Code
namespace
{
wxsRegisterItem<wxsAnimationCtrl> Reg(_T("AnimationCtrl"),wxsTWidget,_T("Standard"),370);
The constructor of wxsRegisterItem (in wxsitemfactory.h:200) calls wxBitmap::LoadFile(), but this call will happen before the image handlers have been initialized because global objects are constructed before program starts.
Code
wxString DataPath = ConfigManager::GetDataFolder() + _T("/images/wxsmith/");
Info.Icon32.LoadFile(DataPath+Info.ClassName+_T("32.png"),wxBITMAP_TYPE_PNG);
Info.Icon16.LoadFile(DataPath+Info.ClassName+_T("16.png"),wxBITMAP_TYPE_PNG);
One possible solution would be delay loading the icons, i.e. load them the first time they are needed.
Recent Posts
() at /lib64/libgdk_pixbuf-2.0.so.0