aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/QtCore/glue
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2010-01-28 14:53:10 -0200
committerHugo Lima <hugo.lima@openbossa.org>2010-01-28 14:53:10 -0200
commitbf57d0caa20bc6809f9bae61033e0f756d73b9fe (patch)
tree242565557358264a08de962ae218f29a3a094320 /PySide/QtCore/glue
parentf33140602f8aee732cfa9c07311a555d28fa0621 (diff)
Do not allow more than 2 instances of QCoreApplication (or QApplication).
Diffstat (limited to 'PySide/QtCore/glue')
-rw-r--r--PySide/QtCore/glue/qcoreapplication_impl.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/PySide/QtCore/glue/qcoreapplication_impl.cpp b/PySide/QtCore/glue/qcoreapplication_impl.cpp
index 70f06cb34..b6d3bf731 100644
--- a/PySide/QtCore/glue/qcoreapplication_impl.cpp
+++ b/PySide/QtCore/glue/qcoreapplication_impl.cpp
@@ -1,5 +1,10 @@
int SbkQCoreApplication_Init(PyObject* self, PyObject* args, PyObject*)
{
+ if (QCoreApplication::instance()) {
+ PyErr_SetString(PyExc_RuntimeError, "A QCoreApplication instance already exists.");
+ return -1;
+ }
+
int numArgs = PyTuple_GET_SIZE(args);
if (numArgs != 1) {
PyErr_BadArgument();