diff mac/dw.m @ 2374:2a7fed3d11f5

Mac: Switch to performSelector: instead of calling implementation directly. The parameter was NULL on ARM (M1) MacOS for some reason. We call directly other places too, so might need to check more places but this fixes the crashes.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 18 Mar 2021 00:01:37 +0000
parents 707836e00e5e
children 6feefce31675
line wrap: on
line diff
--- a/mac/dw.m	Wed Mar 17 03:17:58 2021 +0000
+++ b/mac/dw.m	Thu Mar 18 00:01:37 2021 +0000
@@ -1237,12 +1237,7 @@
         DWTID curr = pthread_self();
 
         if(DWThread == (DWTID)-1 || DWThread == curr)
-        {
-            DWIMP imp = (DWIMP)[self methodForSelector:sel];
-
-            if(imp)
-                imp(self, sel, param);
-        }
+            [self performSelector:sel withObject:param];
         else
             [self performSelectorOnMainThread:sel withObject:param waitUntilDone:YES];
     }