Commit 6c77158
committed
BUG: Fix crash when restarting OSX single shot timer (Fixes #9655)
Previously, if we had a pointer to an old timer when calling start(), we
would manually get the context for the old timer and from there get a
pointer to the attribute. The problem is that for a single-timer, the
timer is automatically invalidated (and context cleared) at the end.
This resulted in trying to Py_DECREF(0x0).
To fix this, use the built-in support for a callback to run when the
context is released. By doing so, we can also clean up a lot of code to
release the reference in stop() as well.1 parent c465993 commit 6c77158
1 file changed
Lines changed: 8 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2887 | 2887 | | |
2888 | 2888 | | |
2889 | 2889 | | |
| 2890 | + | |
| 2891 | + | |
| 2892 | + | |
| 2893 | + | |
| 2894 | + | |
2890 | 2895 | | |
2891 | 2896 | | |
2892 | 2897 | | |
| |||
2904 | 2909 | | |
2905 | 2910 | | |
2906 | 2911 | | |
2907 | | - | |
| 2912 | + | |
2908 | 2913 | | |
2909 | 2914 | | |
2910 | 2915 | | |
| |||
2958 | 2963 | | |
2959 | 2964 | | |
2960 | 2965 | | |
2961 | | - | |
2962 | | - | |
2963 | | - | |
2964 | | - | |
| 2966 | + | |
2965 | 2967 | | |
2966 | 2968 | | |
2967 | 2969 | | |
| |||
2977 | 2979 | | |
2978 | 2980 | | |
2979 | 2981 | | |
2980 | | - | |
2981 | | - | |
2982 | | - | |
2983 | | - | |
2984 | | - | |
2985 | | - | |
2986 | | - | |
2987 | | - | |
2988 | | - | |
| 2982 | + | |
2989 | 2983 | | |
2990 | 2984 | | |
2991 | 2985 | | |
| |||
0 commit comments