Memory leak? sysfer.dll access violation exception
Hello,
i have written a qml-map widget which gets displayed, but there seems to be an "undefined" object or something like that. I get an access violation exception from sysfer.dll.
I currently don't know where this comes from. Any help would be appreciated!
main.cpp
Code:
#include <QtWidgets/QApplication>
#include <MainWindow.h>
int main(int argc, char *argv[])
{
// load resources from binary
// infos: http://doc.qt.io/qt-5/resources.html
Q_INIT_RESOURCE(qmlsources);
MainWindow mw;
mw.show();
return a.exec();
}
MainWindow.h:
Code:
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QtWidgets/QWidget>
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QMenu>
#include <QtWidgets/QMenuBar>
#include <QtWidgets/QLabel>
{
Q_OBJECT
public:
MainWindow();
~MainWindow();
protected:
private slots:
void quit();
private:
void createMenus();
void createActions();
};
#endif // MAINWINDOW_H
MainWindow.cpp:
Code:
#include <QDir>
#include <QtWidgets/QWidget>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QMenu>
#include <QtWidgets/QMenuBar>
#include <QtWidgets/QLabel>
#include <QtWidgets/QBoxLayout>
#include <QtGui/QContextMenuEvent>
#include <QQmlEngine>
#include <QQmlComponent>
#include <QQuickView>
#include <QQuickWidget>
#include "MainWindow.h"
{
// embed resources into binary
// infos: http://doc.qt.io/qt-5/resources.html
Q_INIT_RESOURCE(qmlsources);
this->resize(1024, 768);
createActions();
createMenus();
//WORKS!!!
QQmlEngine *engine = new QQmlEngine(this);
QQuickWidget *view = new QQuickWidget(engine, this);
view
->setSource
(QUrl("qrc:/map.qml"));
this->setCentralWidget(view);
view->setResizeMode(QQuickWidget::SizeRootObjectToView);
}
MainWindow::~MainWindow()
{
}
{
menu.addAction(_quitAct);
menu.exec(event->globalPos());
}
void MainWindow::createMenus()
{
_fileMenu = menuBar()->addMenu(tr("File"));
_fileMenu -> addAction(_quitAct);
}
void MainWindow::createActions()
{
_quitAct
= new QAction(tr
("Quit"),
this);
connect(_quitAct, &QAction::triggered, this, &MainWindow::quit);
}
void MainWindow::quit()
{
// _infoLabel->setText(tr("Invoked <b>File|Quit</b>"));
exit(1);
}
map.qml:
Code:
import QtQuick 2.3
import QtPositioning 5.6
import QtLocation 5.6
Map {
id: map
width: 640
height:480
plugin: Plugin {
name: "osm"
}
center {
latitude: -27
longitude: 153
}
zoomLevel: 10
gesture.enabled: true
Component.onCompleted: {
console.log("Dimensions: ", width, height)
}
}
Using VisualStudio2015 Ultimate, compiling as debug mode!
Thanks in advance for any hint or comment!
Re: Memory leak? sysfer.dll access violation exception
Quote:
I currently don't know where this comes from. Any help would be appreciated!
You are ahead of us... We don't even know what the error message was.
Run the program in your debugger and get a stack backtrace when it crashes. Read down the trace until you find the first line of your code that is mentioned.
Re: Memory leak? sysfer.dll access violation exception
Debugging is not possible since i don't have pdb files for sysfer.dll.
Re: Memory leak? sysfer.dll access violation exception
Sysfer.dll is not your code, so the absence of the ability to debug it is largely irrelevant. Read down the backtrace until you reach the first line of your code that is mentioned. This is the trigggering event and the place to start working out what your code has done. In all likelihood you are trying to use a null, uninitialised, or invalid pointer.
Re: Memory leak? sysfer.dll access violation exception
I have found out, that the access violation happens when i use the scroll-wheel of my mouse.
I assume, that i need to re-implement the mouse events, because the scroll-functionality may lead to not getting new data within the OSM interface.
My stack trace only tells me, that the error happens in the external dll.
But right after using the scroll-wheel.
Any hint would be appreciated.