Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 450ae9f

Browse files
committed
Don't free the MacOS_Splash() dialog twice...
1 parent 48c5527 commit 450ae9f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Mac/Modules/macosmodule.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,15 +502,17 @@ static PyObject *
502502
MacOS_splash(PyObject *self, PyObject *args)
503503
{
504504
int resid = -1;
505-
static DialogPtr curdialog;
505+
static DialogPtr curdialog = NULL;
506506
WindowRef theWindow;
507507
CGrafPtr thePort;
508508
short xpos, ypos, width, height, swidth, sheight;
509509

510510
if (!PyArg_ParseTuple(args, "|i", &resid))
511511
return NULL;
512-
if (curdialog)
512+
if (curdialog) {
513513
DisposeDialog(curdialog);
514+
curdialog = NULL;
515+
}
514516

515517
if ( resid != -1 ) {
516518
curdialog = GetNewDialog(resid, NULL, (WindowPtr)-1);

0 commit comments

Comments
 (0)