mirror of https://github.com/nicolargo/glances.git
fix(profiler): handle missing _counts in reset() during init
This commit is contained in:
parent
8c52a114c1
commit
d3271af5d5
|
|
@ -84,7 +84,10 @@ class PluginModel(GlancesPluginModel):
|
|||
def reset(self):
|
||||
"""Reset stats."""
|
||||
self.stats = []
|
||||
self._counts.clear()
|
||||
if hasattr(self, '_counts'):
|
||||
self._counts.clear()
|
||||
else:
|
||||
self._counts = Counter()
|
||||
|
||||
def update(self):
|
||||
"""Update stats."""
|
||||
|
|
|
|||
Loading…
Reference in New Issue