Skip to content

Fix segfault at application start under gcc on linux#57

Open
PetersTom wants to merge 1 commit intoSOPSLab:devfrom
PetersTom:dev
Open

Fix segfault at application start under gcc on linux#57
PetersTom wants to merge 1 commit intoSOPSLab:devfrom
PetersTom:dev

Conversation

@PetersTom
Copy link

As per the Qt5 QApplication documentation (https://doc.qt.io/qt-5/qapplication.html#QApplication):

Warning: The data referred to by argc and argv must stay valid for the entire lifetime of the QApplication object. In addition, argc must be greater than zero and argv must contain at least one valid character string.

Currently, argc is is passed by value, which goes out of scope at the end of the Application constructor. Under mingw this was not an issue. However, under gcc (on linux) a segfault occurs when trying to run the application. Passing by reference fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant