From 775ff127a4072471f28d4b7d4b2819214d2be19f Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Tue, 10 Aug 2010 12:16:10 +0100 Subject: [PATCH] Python: only call ns3::Simulator::RunOne if we're running the default event scheduler; partially fixes Bug 631. --- bindings/python/ns3module_helpers.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bindings/python/ns3module_helpers.cc b/bindings/python/ns3module_helpers.cc index c7692a0bb..92c3cefb3 100644 --- a/bindings/python/ns3module_helpers.cc +++ b/bindings/python/ns3module_helpers.cc @@ -285,7 +285,15 @@ _wrap_Simulator_Run(PyNs3Simulator *PYBINDGEN_UNUSED(dummy), PyObject *args, PyO PyObject **return_exception) { const char *keywords[] = {"signal_check_frequency", NULL}; - int signal_check_frequency = 100; + int signal_check_frequency; + + ns3::Ptr defaultSim = + ns3::DynamicCast (ns3::Simulator::GetImplementation ()); + if (defaultSim) { + signal_check_frequency = 100; + } else { + signal_check_frequency = -1; + } if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "|i", (char **) keywords, &signal_check_frequency)) { PyObject *exc_type, *traceback;