mirror of https://gitlab.com/pamhyr/pamhyr2
GeoTIFF: Fix crashes at 'cannot remove artist'.
parent
da78d0cdb1
commit
8182d434ec
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from tools import trace, timer
|
||||
from tools import trace, timer, logger_exception
|
||||
|
||||
from PyQt5.QtWidgets import (
|
||||
QAction, QListView, QVBoxLayout,
|
||||
|
|
@ -134,7 +134,10 @@ class GeoTIFFListWindow(PamhyrWindow):
|
|||
|
||||
def _update_rectangle(self):
|
||||
for rect in self._plot_rect:
|
||||
rect.remove()
|
||||
try:
|
||||
rect.remove()
|
||||
except Exception as e:
|
||||
logger_exception(e)
|
||||
|
||||
self._plot_rect = []
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import logging
|
|||
|
||||
from functools import reduce
|
||||
|
||||
from tools import timer, trace
|
||||
from tools import timer, trace, logger_exception
|
||||
from View.Tools.PamhyrPlot import PamhyrPlot
|
||||
import numpy as np
|
||||
from matplotlib import collections
|
||||
|
|
@ -332,7 +332,10 @@ class PlotXY(PamhyrPlot):
|
|||
lst = self._data[0]._study.river._geotiff.lst
|
||||
|
||||
for img in self._plot_img:
|
||||
self._plot_img[img].remove()
|
||||
try:
|
||||
self._plot_img[img].remove()
|
||||
except Exception as e:
|
||||
logger_exception(e)
|
||||
|
||||
self._plot_img = {}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue