kopia lustrzana https://github.com/sepandhaghighi/samila
Memory leakage bug (#97)
* fix : __del__ method added #91 * fix : __del__ method updated * doc : CHANGELOG updated #91pull/102/head
rodzic
fa6f0040de
commit
fed58e0ee3
|
@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||
|
||||
## [Unreleased]
|
||||
### Added
|
||||
- `__del__` method
|
||||
- `alpha` attribute
|
||||
- Demo notebook
|
||||
### Changed
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Samila generative image."""
|
||||
import random
|
||||
import gc
|
||||
import itertools
|
||||
import matplotlib
|
||||
import matplotlib.pyplot as plt
|
||||
|
@ -172,3 +173,16 @@ class GenerativeImage:
|
|||
:return: result as a dict
|
||||
"""
|
||||
return save_config_file(self, file_adr)
|
||||
|
||||
def __del__(self):
|
||||
"""
|
||||
Deconstructor.
|
||||
|
||||
:return:None
|
||||
"""
|
||||
if self.fig is not None:
|
||||
self.fig.clf()
|
||||
plt.close(self.fig)
|
||||
del(self.data1)
|
||||
del(self.data2)
|
||||
gc.collect()
|
||||
|
|
Ładowanie…
Reference in New Issue