Call QgsRasterBlock destructor from SIP (add factory)

Fixes #31343 memory leak
This commit is contained in:
Alessandro Pasotti 2019-08-22 11:27:40 +02:00 committed by Nyall Dawson
parent 9ae5ff5c52
commit 631ac63e57
4 changed files with 4 additions and 4 deletions

View File

@ -51,7 +51,7 @@ Factory method to create a new renderer
virtual void writeXml( QDomDocument &doc, QDomElement &parentElem ) const;
virtual QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = 0 );
virtual QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = 0 ) /Factory/;
virtual QList<int> usesBands() const;

View File

@ -152,7 +152,7 @@ Read band offset for raster value
%End
virtual QgsRasterBlock *block( int bandNo, const QgsRectangle &boundingBox, int width, int height, QgsRasterBlockFeedback *feedback = 0 );
virtual QgsRasterBlock *block( int bandNo, const QgsRectangle &boundingBox, int width, int height, QgsRasterBlockFeedback *feedback = 0 ) /Factory/;
%Docstring
Read block of data using given extent and size.

View File

@ -58,7 +58,7 @@ class CORE_EXPORT QgsHillshadeRenderer : public QgsRasterRenderer
void writeXml( QDomDocument &doc, QDomElement &parentElem ) const override;
QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override;
QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override SIP_FACTORY;
QList<int> usesBands() const override;

View File

@ -229,7 +229,7 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRast
// TODO: remove or make protected all readBlock working with void*
//! Read block of data using given extent and size.
QgsRasterBlock *block( int bandNo, const QgsRectangle &boundingBox, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override;
QgsRasterBlock *block( int bandNo, const QgsRectangle &boundingBox, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override SIP_FACTORY;
//! Returns TRUE if source band has no data value
virtual bool sourceHasNoDataValue( int bandNo ) const { return mSrcHasNoDataValue.value( bandNo - 1 ); }