Author Topic: [trunk] OsX Catalina: crash on init due to wxTheClipboard issue  (Read 2493 times)

Offline perazz

  • Multiple posting newcomer
  • *
  • Posts: 16
[trunk] OsX Catalina: crash on init due to wxTheClipboard issue
« on: February 08, 2022, 07:55:41 pm »
Hi,

I'm a longtime C::B user but new to developing and contributing to this forum - sorry if I'm posting in the wrong place.
I've just managed to build C::B trunk on Mac OSX Catalina (arm64). I would like to help debuggin/bugfixing on Mac.

The app does not open because of an assert issue with the clipboard.

I think it's related to this mac-specific bug: https://github.com/OSGeo/grass/pull/819. It's fixed if the call to Flush() is only made if the clipboard IsOpened():
applies to both OnInit (src/app.cpp, line 581) and OnExit (src/app.cpp, line 829)
and I solved it by wrapping:

Code
   if (wxTheClipboard->IsOpened()) {
        wxTheClipboard->Flush();
      }

Is this the right way to suggest a bug fix?
Thanks for the hard work on C::B,

Federico





Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3255
Re: [trunk] OsX Catalina: crash on init due to wxTheClipboard issue
« Reply #1 on: February 08, 2022, 11:28:04 pm »
Hi,
Quote
I would like to help debuggin/bugfixing on Mac.
Highly appreciated!!! Thank you!

Quote
Is this the right way to suggest a bug fix?
The best way for bug fixes and patches is to provide them on sourceforge.
Here they will get lost in the noise of normal forum posts

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 649
Re: [trunk] OsX Catalina: crash on init due to wxTheClipboard issue
« Reply #2 on: February 09, 2022, 12:46:45 am »
Posted in the right forum and good to see a Mac dev trying to help out.

The following wiki page has info on patches and info on the C::B SF ticket process:
   https://wiki.codeblocks.org/index.php/Creating_a_patch_to_submit_(Patch_Tracker)
Unfortunately the page is for Windows/Linux, so not all of the info may be applicable or may work on OSX, but a large chunk of it will. The page info on submitting a patch is not right, create a ticket and attach the patch.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1110
Re: [trunk] OsX Catalina: crash on init due to wxTheClipboard issue
« Reply #3 on: February 15, 2022, 06:36:54 pm »
@perazz or @Xaviou, would this be acceptable?

Code
#ifdef __WXOSX_MAC__
if (wxTheClipboard->IsOpened())
#endif
        wxTheClipboard->Flush();

or, is there a method to check specifically for Catalina?

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1110
Re: [trunk] OsX Catalina: crash on init due to wxTheClipboard issue
« Reply #4 on: September 19, 2022, 01:14:36 pm »
Fixed in r12901.