What is the bug or the crash?
Error is : Debug assertion failed
Expression : _CtrlsValidHeapPointer(block)
IMPORTANT : don't crash if I compile in release mode, crashes in debug mode.
'Identify' function systematically crashes.
Steps to reproduce the issue
Compile and run the code in DEBUG mode.
Then :
- add a shape layer on the canvas ;
- activate an instance of MyIdentifyMapTool as the current map tool ;
- click anywhere on the shape layer ;
Identify function crashes.
MyIdentifyMapTool.h :
#pragma once
#include "qgsmapcanvas.h"
#include "qgssettings.h"
#include "qgsmaptoolidentify.h"
#include "QgsMapMouseEvent.h"
class MyIdentifyMapTool : public QgsMapToolIdentify
{
Q_OBJECT
private:
void canvasReleaseEvent(QgsMapMouseEvent* e) override;
public:
MyIdentifyMapTool(QgsMapCanvas* canvas);
~MyIdentifyMapTool();
};
MyIdentifyMapTool.cpp :
#include "MyIdentifyMapTool.h"
MyIdentifyMapTool::MyIdentifyMapTool(QgsMapCanvas* mapCanvas) : QgsMapToolIdentify(mapCanvas) {
}
void MyIdentifyMapTool::canvasReleaseEvent(QgsMapMouseEvent* e)
{
const QgsPointXY point = e->snapPoint();
QgsMapCanvas* canvas = this->canvas();
if (e->button() == Qt::LeftButton) {
QList<IdentifyResult> resultats = identify(e->x(), e->y(), QgsMapToolIdentify::TopDownAll, canvas->layers(), QgsMapToolIdentify::VectorLayer);
}
}
Versions
C++ API from QGIS 3.40 LTR
Supported QGIS version
New profile
Additional context
No response
What is the bug or the crash?
Error is : Debug assertion failed
Expression : _CtrlsValidHeapPointer(block)
IMPORTANT : don't crash if I compile in release mode, crashes in debug mode.
'Identify' function systematically crashes.
Steps to reproduce the issue
Compile and run the code in DEBUG mode.
Then :
Identify function crashes.
MyIdentifyMapTool.h :
MyIdentifyMapTool.cpp :
Versions
C++ API from QGIS 3.40 LTR
Supported QGIS version
New profile
Additional context
No response