Skip to content

Commit

Permalink
fix: creating a copy of signalstring
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-ramos authored and micieslak committed Feb 9, 2023
1 parent 0b41a9b commit 7a286e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vendor/DOtherSide/lib/src/DOtherSide.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,8 @@ ::DosQMetaObject *dos_qmetaobject_create(::DosQMetaObject *superClassVPtr,
void dos_signal(::DosQObject *vptr, const char *signal, const char *slot) //
{
auto qobject = static_cast<QObject *>(vptr);
QMetaObject::invokeMethod(qobject, slot, Qt::QueuedConnection, Q_ARG(QString, signal));
std::string copy = signal; // signal comes from nim, and might be GC. Creating a copy (QT will handle the freeing)
QMetaObject::invokeMethod(qobject, slot, Qt::QueuedConnection, Q_ARG(QString, copy.c_str()));
}

void dos_qmetaobject_delete(::DosQMetaObject *vptr)
Expand Down

0 comments on commit 7a286e5

Please sign in to comment.