Skip to content

Commit

Permalink
Do not paint WMS preview images. Because it crashes.
Browse files Browse the repository at this point in the history
Fix #16803
  • Loading branch information
m-kuhn committed Oct 31, 2017
1 parent 6f9798b commit fde6240
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/providers/wms/qgswmsprovider.cpp
Expand Up @@ -615,11 +615,16 @@ static void _drawDebugRect( QPainter& p, const QRectF& rect, const QColor& color

QImage *QgsWmsProvider::draw( QgsRectangle const & viewExtent, int pixelWidth, int pixelHeight, QgsRasterBlockFeedback* feedback )
{
QgsDebugMsg( "Entering." );
QImage* image = new QImage( pixelWidth, pixelHeight, QImage::Format_ARGB32 );

if ( QgsApplication::instance()->thread() == QThread::currentThread() )
{
QgsDebugMsg( "Trying to draw a WMS image on the main thread. Stop it!" );
return image;
}

// compose the URL query string for the WMS server.

QImage* image = new QImage( pixelWidth, pixelHeight, QImage::Format_ARGB32 );
image->fill( 0 );

if ( !mSettings.mTiled && mSettings.mMaxWidth == 0 && mSettings.mMaxHeight == 0 )
Expand Down

0 comments on commit fde6240

Please sign in to comment.