]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/helpers.cpp
Corrections and additions to the wxODBC docs
[wxWidgets.git] / wxPython / src / helpers.cpp
index 715c3e357678a6341d6f8297400bafc5fcfbde94..b59f95f5fe6736cb431b99fa561ca8e865b1a935 100644 (file)
@@ -561,20 +561,26 @@ wxPyTimer::~wxPyTimer() {
 }
 
 void wxPyTimer::Notify() {
-    bool doSave = wxPyRestoreThread();
-
-    PyObject*   result;
-    PyObject*   args = Py_BuildValue("()");
+    if (!func || func == Py_None) {
+        wxTimer::Notify();
+    }
+    else {
+        bool doSave = wxPyRestoreThread();
+
+        PyObject*   result;
+        PyObject*   args = Py_BuildValue("()");
+
+        result = PyEval_CallObject(func, args);
+        Py_DECREF(args);
+        if (result) {
+            Py_DECREF(result);
+            PyErr_Clear();
+        } else {
+            PyErr_Print();
+        }
 
-    result = PyEval_CallObject(func, args);
-    Py_DECREF(args);
-    if (result) {
-        Py_DECREF(result);
-        PyErr_Clear();
-    } else {
-        PyErr_Print();
+        wxPySaveThread(doSave);
     }
-    wxPySaveThread(doSave);
 }