mirror of https://github.com/KLayout/klayout.git
Fixed a memory bug
This commit is contained in:
parent
f827e693ef
commit
d0f566f84e
|
|
@ -640,7 +640,7 @@ LayoutCanvas::paintEvent (QPaintEvent *)
|
||||||
|
|
||||||
// render the foreground parts ..
|
// render the foreground parts ..
|
||||||
if (m_oversampling == 1) {
|
if (m_oversampling == 1) {
|
||||||
QImage img = full_image.to_image ();
|
QImage img = full_image.to_image_copy (); // NOTE: seems like it's required to create a copy as QPixmap stores a reference to the image
|
||||||
#if QT_VERSION > 0x050000
|
#if QT_VERSION > 0x050000
|
||||||
img.setDevicePixelRatio (double (m_dpr));
|
img.setDevicePixelRatio (double (m_dpr));
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -649,7 +649,7 @@ LayoutCanvas::paintEvent (QPaintEvent *)
|
||||||
lay::PixelBuffer subsampled_image (m_viewport.width (), m_viewport.height ());
|
lay::PixelBuffer subsampled_image (m_viewport.width (), m_viewport.height ());
|
||||||
subsampled_image.set_transparent (mp_image->transparent ());
|
subsampled_image.set_transparent (mp_image->transparent ());
|
||||||
subsample (full_image, subsampled_image, m_oversampling, m_gamma);
|
subsample (full_image, subsampled_image, m_oversampling, m_gamma);
|
||||||
QImage img = subsampled_image.to_image ();
|
QImage img = subsampled_image.to_image_copy (); // NOTE: seems like it's required to create a copy as QPixmap stores a reference to the image
|
||||||
#if QT_VERSION > 0x050000
|
#if QT_VERSION > 0x050000
|
||||||
img.setDevicePixelRatio (double (m_dpr));
|
img.setDevicePixelRatio (double (m_dpr));
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -658,7 +658,7 @@ LayoutCanvas::paintEvent (QPaintEvent *)
|
||||||
|
|
||||||
} else if (m_oversampling == 1) {
|
} else if (m_oversampling == 1) {
|
||||||
|
|
||||||
QImage img = mp_image->to_image ();
|
QImage img = mp_image->to_image_copy (); // NOTE: seems like it's required to create a copy as QPixmap stores a reference to the image
|
||||||
#if QT_VERSION > 0x050000
|
#if QT_VERSION > 0x050000
|
||||||
img.setDevicePixelRatio (double (m_dpr));
|
img.setDevicePixelRatio (double (m_dpr));
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -669,7 +669,7 @@ LayoutCanvas::paintEvent (QPaintEvent *)
|
||||||
lay::PixelBuffer subsampled_image (m_viewport.width (), m_viewport.height ());
|
lay::PixelBuffer subsampled_image (m_viewport.width (), m_viewport.height ());
|
||||||
subsampled_image.set_transparent (mp_image->transparent ());
|
subsampled_image.set_transparent (mp_image->transparent ());
|
||||||
subsample (*mp_image, subsampled_image, m_oversampling, m_gamma);
|
subsample (*mp_image, subsampled_image, m_oversampling, m_gamma);
|
||||||
QImage img = subsampled_image.to_image ();
|
QImage img = subsampled_image.to_image_copy (); // NOTE: seems like it's required to create a copy as QPixmap stores a reference to the image
|
||||||
#if QT_VERSION > 0x050000
|
#if QT_VERSION > 0x050000
|
||||||
img.setDevicePixelRatio (double (m_dpr));
|
img.setDevicePixelRatio (double (m_dpr));
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue