User forums > Help

code::blocks hangs at startup

<< < (6/7) > >>

Miguel Gimenez:

--- Quote ---not sure if really usable
--- End quote ---

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);

--- End code ---

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);

--- End code ---

One possible solution would be delay loading the icons, i.e. load them the first time they are needed.

Miguel Gimenez:
I have just commited r13775 implementing delay-load of most images. This commit will make easier changing to SVG in the near future.

wxsresourcetree must still be modified before checking if C::B still hangs at startup.

killerbot:
I will test later today

Miguel Gimenez:
The change is not finished, wxsresourcetree must be modified.

killerbot:
I reverted the patch that was posted here above yesterday,and used your latest commit.

CB now starts up for me without problems (or at least not directly visible to me ;-) )

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version