Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: perazz on February 08, 2022, 07:55:41 pm

Title: [trunk] OsX Catalina: crash on init due to wxTheClipboard issue
Post by: perazz 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 (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




Title: Re: [trunk] OsX Catalina: crash on init due to wxTheClipboard issue
Post by: BlueHazzard 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
Title: Re: [trunk] OsX Catalina: crash on init due to wxTheClipboard issue
Post by: AndrewCot 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 (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.
Title: Re: [trunk] OsX Catalina: crash on init due to wxTheClipboard issue
Post by: Miguel Gimenez 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?
Title: Re: [trunk] OsX Catalina: crash on init due to wxTheClipboard issue
Post by: Miguel Gimenez on September 19, 2022, 01:14:36 pm
Fixed in r12901.