ref: c97fe4693f6112504d6f13fab46f7cc8b27685c1
parent: df9c9a8f7c088cb52d5feb0757b51e69bffd380d
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Mon Jun 28 15:29:39 EDT 2021
drawterm/gui-cocoa/screen.m: fix SEGFAULT during cursor updates (thanks Igor) The patch contains the following modifications: 1. Fix declaration of `currentCursor` declaring it as a property of the `DrawtermView` using the `retain` attribute. This prevents drawterm from crashing as the OSX graphical event loop refrains from deallocating it while it is still in use. 2. Modification of gui-cocoa/screen.m:/^setcursor to use 'getBitmapDataPlanes' API function instead of 'static unsigned char data[64]' container. (https://developer.apple.com/documentation/appkit/nsbitmapimagerep/1395490-getbitmapdataplanes?language=objc) The idea is to avoid using static variables for memory managed/supplied by OSX APIs. 3. Replace 'static GLuint tex;' and declare it as a property of the `DrawtermView` as it is part of the `DrawtermView`. 4. Move up declaration of 'DrawtermView' within the file. Once the static variables like 'currentCursor' and 'tex' have been moved to be properties of the DrawtermView this change made sense. This patch has been tested on OSX Catalina and Big Sur.