Author Topic: cbSplashScreen corrupts memory with wxWidgets >= 3.0, proposed patch  (Read 452 times)

Offline Miguel Gimenez

  • Multiple posting newcomer
  • *
  • Posts: 87
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10841
    • Travis build status
Re: cbSplashScreen corrupts memory with wxWidgets >= 3.0, proposed patch
« Reply #1 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?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Miguel Gimenez

  • Multiple posting newcomer
  • *
  • Posts: 87
Re: cbSplashScreen corrupts memory with wxWidgets >= 3.0, proposed patch
« Reply #2 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.

Offline Miguel Gimenez

  • Multiple posting newcomer
  • *
  • Posts: 87
Re: cbSplashScreen corrupts memory with wxWidgets >= 3.0, proposed patch
« Reply #3 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.
« Last Edit: March 12, 2018, 11:26:53 am by Miguel Gimenez »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10841
    • Travis build status
Re: cbSplashScreen corrupts memory with wxWidgets >= 3.0, proposed patch
« Reply #4 on: March 12, 2018, 08:29:48 pm »
Commited and issue closed. Thanks.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]