From f2e66a280ccdd18a3f1984ddde3e4dde8ec0d252 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 28 Dec 2020 15:27:56 +0100 Subject: [PATCH] deploy-stub: Fix immediate exit on Windows if no log_filename is set --- pandatool/src/deploy-stub/deploy-stub.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pandatool/src/deploy-stub/deploy-stub.c b/pandatool/src/deploy-stub/deploy-stub.c index 1668b63c0d..21b99b2fb0 100644 --- a/pandatool/src/deploy-stub/deploy-stub.c +++ b/pandatool/src/deploy-stub/deploy-stub.c @@ -360,15 +360,20 @@ static int enable_line_buffering(PyObject *file) { if (method != NULL) { PyObject *result = PyObject_Call(method, args, kwargs); Py_DECREF(method); + Py_DECREF(kwargs); + Py_DECREF(args); if (result != NULL) { Py_DECREF(result); } else { PyErr_Clear(); return 0; } + } else { + Py_DECREF(kwargs); + Py_DECREF(args); + PyErr_Clear(); + return 0; } - Py_DECREF(kwargs); - Py_DECREF(args); #else /* Older versions just don't expose a way to reconfigure(), but it's still safe to override the property; we just have to use a hack to do it,