mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 00:48:38 +00:00
bindings: fix segfault in QApplication_new taking arg by reference
This commit is contained in:
parent
fea87aff42
commit
48ab3420ff
@ -3,8 +3,9 @@
|
||||
#include <QWidget>
|
||||
#include <QPushButton>
|
||||
|
||||
PQApplication QApplication_new(int argc, char** argv) {
|
||||
return new QApplication(argc, argv);
|
||||
PQApplication QApplication_new(int* argc, char** argv) {
|
||||
// QApplication takes these parameters byref, not by value
|
||||
return new QApplication(*argc, argv);
|
||||
}
|
||||
|
||||
PQWidget QWidget_new() {
|
||||
|
@ -30,7 +30,8 @@ type QApplication struct {
|
||||
}
|
||||
|
||||
func NewQApplication(args []string) *QApplication {
|
||||
h := C.QApplication_new(CArray(args))
|
||||
argc, argv := CArray(args)
|
||||
h := C.QApplication_new(&argc, argv)
|
||||
return &QApplication{h: h}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user