If I compile my plugin with Option Runtime Library:
Multi-threaded Debug DLL (/MDd)
at first sight it works fine, but while closing QGIS, QGIS crashes with 
'HEAP CORRUPTION DETECTED'


Then if my plugin is 
Compiled with Option Runtime Library:
Multi-threaded DLL (/MD)


I get the error:

>       msvcr100.dll!free(void * pBlock)  Line 51       C

during deleting the symollayer from this code:

QgsSymbolV2 * p_Symbol(0);
bool oFirst=true;

...

if (oFirst)
{
        QgsFillSymbolV2* p_FSymbol = new 
QgsFillSymbolV2();//QgsSymbolLayerV2List()
        p_Symbol = dynamic_cast <QgsSymbolV2 *>(p_FSymbol);
        qDebug()<<QString::number((int)p_Symbol,16);
        qDebug()<<QString::number(p_Symbol->symbolLayerCount());
        if (p_Symbol->symbolLayerCount()==1)
                p_Symbol->deleteSymbolLayer(0);
        oFirst=false;
}
...

Output:

"1847bca0" 
"1" 
First-chance exception at 0x77e4e43e in qgis-bin.exe: 0xC0000005: Access 
violation reading location 0x4d46be13.
Unhandled exception at 0x77e4e43e in qgis-bin.exe: 0xC0000005: Access 
violation reading location 0x4d46be13.


Could this correspond with the message: "QgsFillSymbol::scalar deleting 
destructor"?
It's horrible for me with the pointers :-o
I create the FillSymbol with "new" in my DLL but something's going wrong 
by deleting.
Any hope for me?

Freundliche Grüße aus Leipzig
Susann Schmidt
Softwareentwicklung 

**************************************************************

GFI - Gesellschaft für Informationstechnologie mbH
Philipp-Rosenthal-Straße 9
D-04103 Leipzig
Geschäftsführer: Andreas Richter
Amtsgericht Leipzig HRB 12054
USt.-IdNr.: DE179049354     Steuer-Nr.: 231/109/06412
ESRI Solution Partner      und       ER Mapper Reseller
Tel. 0341 961 3310    Fax 0341 961 3311   Mail i...@gfi-gis.de
Web  www.gfi-gis.de  und  www.themenbrowser.de

----- Weitergeleitet von Susann Schmidt/gfimbh am 04.09.2017 09:46 -----

Von:    Susann Schmidt/gfimbh
An:     QGIS-Developer@lists.osgeo.org
Datum:  01.09.2017 13:02
Betreff:        Re: [QGIS-Developer] crash qgis 2.18.11 in vs2010 - HEAP 
CORRUPTION DETECTED


Hallo Jürgen,

I think not I use it directly, because I'm only including h-files from 
qgis and qt:

#include "QGISFunc.h"
#include <QtDebug>
#include <QtCore>
#include <QMessageBox>
#include <QFile>
#include <QFileInfo>
#include <QDomDocument>
#include <QDomElement>
#include <QDateTime>
#include <QXmlStreamAttributes>
#include <QToolBar>
#include <QAction>
#include <QHostInfo>
#include <qgsrasterlayer.h>
#include <qgsmapcanvas.h>
#include <qgsmaplayerregistry.h>
#include <qgslegendinterface.h>
#include <qgsrasterrenderer.h>
#include <qgsrendererv2.h>
#include "qgsdatasourceuri.h"
#include <qgsvectorlayer.h>
#include <qgscategorizedsymbolrendererv2.h>
#include <qgsgraduatedsymbolrendererv2.h>
#include <qgssinglesymbolrendererv2.h>
#include <qgsrulebasedrendererv2.h>
#include <qgscategorizedsymbolrendererv2.h>
#include "qgssymbollayerv2.h"
#include <qgsmarkersymbollayerv2.h>
#include <qgslinesymbollayerv2.h>
#include <qgsfillsymbollayerv2.h>
#include <qgsvectorcolorrampv2.h>
#include <qgsvectordataprovider.h>
#include <qgsattributeaction.h>
#include <qgsapplication.h>
#include <qgsfield.h>
#include <qgslabel.h>
#include <qgspallabeling.h>
#include <qgsrulebasedlabeling.h>
#include <QgsMapLayerActionRegistry.h>
#include <qgsproject.h>
#include <qgslayertreeview.h>
#include <qgslayertreegroup.h>
#include <qgslayertreelayer.h>
#include <qgslayertreenode.h>
#include <qgspainteffect.h>
#include <qgsgloweffect.h>
#include <qgseffectstack.h>
#include <qgsrastershader.h>
#include <qgscolorrampshader.h>
#include <qgssinglebandpseudocolorrenderer.h>
#include <qgspalettedrasterrenderer.h>
#include <qgsrastertransparency.h>

#include <windows.h>
#include <stdio.h>
#include <lmcons.h>



Susann




Von:    Jürgen E. Fischer <j...@norbit.de>
An:     qgis-developer@lists.osgeo.org
Datum:  01.09.2017 11:58
Betreff:        Re: [QGIS-Developer] crash qgis 2.18.11 in vs2010 - HEAP 
CORRUPTION DETECTED
Gesendet von:   "QGIS-Developer" <qgis-developer-boun...@lists.osgeo.org>



Hi Susann,

On Fri, 01. Sep 2017 at 11:23:35 +0200, sschm...@gfi-gis.de wrote:
> since compiling my plugin for qgis 2.18.11 in vs2010 on win7 the plugin 
> and qgis crashes in seemly any action because of memory leaks :-o
> 
> "sometimes" while loading a postgis layer i'll get a message from 
> geos::util::IllegalArgumentException at memory...

Are you using the GEOS C++ API directly or is this from calling QGIS 
methods?


Jürgen

-- 
Jürgen E. Fischer           norBIT GmbH             Tel. 
+49-4931-918175-31
Dipl.-Inf. (FH)             Rheinstraße 13          Fax. 
+49-4931-918175-50
Software Engineer           D-26506 Norden             
http://www.norbit.de
QGIS release manager (PSC)  Germany                    IRC: jef on 
FreeNode
[Anhang "signature.asc" gelöscht von Susann Schmidt/gfimbh] 
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer



_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to