Skip to content

Commit

Permalink
Merge pull request #30033 from elpaso/bugfix-gh29700-histogram-crash
Browse files Browse the repository at this point in the history
Fix histogram bindings

> Is it worth adding a python test for this method? Is there an existing one? Gut feeling is that there's likely NO tests for this method, it predates the focus on stability.

I'll see what I can do.
  • Loading branch information
elpaso committed Jun 3, 2019
2 parents b52d2ad + 1194955 commit 1fcc982
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions python/core/auto_generated/raster/qgsrasterinterface.sip.in
Expand Up @@ -346,8 +346,8 @@ Returns a band histogram. Histograms are cached in providers.
maximum = PyFloat_AsDouble( a3 );
}

QgsRasterHistogram h = sipCpp->histogram( a0, a1, minimum, maximum, *a4, a5, a6, a7 );
sipRes = &h;
QgsRasterHistogram *h = new QgsRasterHistogram( sipCpp->histogram( a0, a1, minimum, maximum, *a4, a5, a6, a7 ) );
return sipConvertFromType( h, sipType_QgsRasterHistogram, Py_None );
%End


Expand Down
4 changes: 2 additions & 2 deletions src/core/raster/qgsrasterinterface.h
Expand Up @@ -378,8 +378,8 @@ class CORE_EXPORT QgsRasterInterface
maximum = PyFloat_AsDouble( a3 );
}

QgsRasterHistogram h = sipCpp->histogram( a0, a1, minimum, maximum, *a4, a5, a6, a7 );
sipRes = &h;
QgsRasterHistogram *h = new QgsRasterHistogram( sipCpp->histogram( a0, a1, minimum, maximum, *a4, a5, a6, a7 ) );
return sipConvertFromType( h, sipType_QgsRasterHistogram, Py_None );
% End
#endif

Expand Down

0 comments on commit 1fcc982

Please sign in to comment.