Changeset 7750c72 in git


Ignore:
Timestamp:
10/07/19 03:43:37 (3 months ago)
Author:
Olly Betts <olly@…>
Branches:
master
Children:
0957d63
Parents:
853438c
Message:

Attempt to work around macOS 10.14 problems

Trying to create a wxPaintDC for the wxGLCanvas window fails with an
assertion about something which it seems is no longer always true in
macOS 10.14. To avoid this we check for the assertion condition first
and temporarily disable assertions while we create the wxPaintDC.

Hopefully this fixes #101, reported by floho.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gfxcore.cc

    r853438c r7750c72  
    376376    // Redraw the window.
    377377
     378#ifdef __WXMAC__
     379    // Attempt to work around wxPaintDC assertion failure on macOS 10.14:
     380    // https://trac.survex.com/ticket/101
     381    bool reenable_assertions = false;
     382    if (MacGetCGContextRef() == NULL && wxTheAssertHandler != NULL) {
     383        wxTheAssertHandler = NULL;
     384        reenable_assertions = true;
     385    }
     386#endif
     387
    378388    // Get a graphics context.
    379389    wxPaintDC dc(this);
     390
     391#ifdef __WXMAC__
     392    if (reenable_assertions) {
     393        wxSetDefaultAssertHandler();
     394    }
     395#endif
    380396
    381397    if (m_HaveData) {
Note: See TracChangeset for help on using the changeset viewer.