Skip to content
Snippets Groups Projects
Commit 803281f2 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Hack to fix SEGV when calling IDL createWindow from embeded python interpreter.

parent 8f9d50d7
No related branches found
No related tags found
No related merge requests found
...@@ -74,6 +74,15 @@ class Client: ...@@ -74,6 +74,15 @@ class Client:
for client in clients: for client in clients:
self.makeClient (client) self.makeClient (client)
# In the python interpreter of gepetto-gui, gui.createWindow
# crashes for an obscure reason. This hack makes it work.
try:
self.gui.createWindow = lambda x: mainWindow.createView(x).wid()
# At this point, we are in the python interpreter of gepetto-gui
except:
# At this point, we are NOT in the python interpreter of gepetto-gui
pass
def _getIIOPurl (): def _getIIOPurl ():
""" """
Returns "corbaloc:iiop:<host>:<port>/NameService" Returns "corbaloc:iiop:<host>:<port>/NameService"
......
...@@ -70,6 +70,10 @@ namespace gepetto { ...@@ -70,6 +70,10 @@ namespace gepetto {
toggleViewAction()->setShortcut(gepetto::gui::DockKeyShortcutBase + Qt::Key_A); toggleViewAction()->setShortcut(gepetto::gui::DockKeyShortcutBase + Qt::Key_A);
connect(button_, SIGNAL(clicked()), SLOT(browseFile())); connect(button_, SIGNAL(clicked()), SLOT(browseFile()));
// Hack to make "createWindow" function work properly
PythonQtObjectPtr client = PythonQt::self()->importModule ("gepetto.corbaserver.client");
client.addObject ("mainWindow", MainWindow::instance());
} }
PythonWidget::~PythonWidget() PythonWidget::~PythonWidget()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment