Code::Blocks

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: Miguel Gimenez on March 08, 2018, 02:44:07 pm

Title: cbSplashScreen corrupts memory with wxWidgets >= 3.0, proposed patch
Post by: Miguel Gimenez on March 08, 2018, 02:44:07 pm
Recently I posted a ticket (635) about Todo plugin failure due to memory corruption. Later I realized the culprit was the splash screen; Removing just the call to Show() or Destroy() was enough to get a working Todo plugin.

wxWidgets has already a wxSplashScreen just for this purpose, so is it really necessary reinventing the wheel with cbSplashScreen?. I have patched app.cpp for using wxSplashScreen and all works as it should (at least on MSW and wx3.1.1). cbSplashScreen addressed some macos peculiarities, but I think the wxWidgets team should take care of them in wxSplashScreen.

I post here instead of creating a ticket to reduce the noise there if the change is not accepted.

I have attached the patch, if accepted it will need a second patch removing all the unneeded methods of cbSplashScreen.
Title: Re: cbSplashScreen corrupts memory with wxWidgets >= 3.0, proposed patch
Post by: oBFusCATed on March 11, 2018, 06:31:31 pm
This patch is not good enough. It leads to crashes in wx2.8 builds on linux, because the m_pSplash is pointing to an invalid object in the Splash::Hide call in app.cpp.

Can you test if the attached patch solves the original problem?
Can you test also wx2.8 builds?
Title: Re: cbSplashScreen corrupts memory with wxWidgets >= 3.0, proposed patch
Post by: Miguel Gimenez on March 12, 2018, 08:31:34 am
The patch works OK with wx3.0.3 and wx2.8.12, MSW10 32 bits and TDM 5.1.

Today I will test wx3.1.1, MSW7 64 bits and MinGW64 with GCC 7.2.0.
Title: Re: cbSplashScreen corrupts memory with wxWidgets >= 3.0, proposed patch
Post by: Miguel Gimenez on March 12, 2018, 11:24:24 am
OK also with wx3.1.1, MSW7 64 bits and MinGW64 with GCC 7.2.0 (generating a 32 bits executable).

I think ticket 635 can be closed now, as the Todo plugin already works.
Title: Re: cbSplashScreen corrupts memory with wxWidgets >= 3.0, proposed patch
Post by: oBFusCATed on March 12, 2018, 08:29:48 pm
Commited and issue closed. Thanks.