mirror of
https://github.com/exyte/Macaw.git
synced 2024-09-11 05:05:23 +03:00
#528 fix memory leak with Image objects
This commit is contained in:
parent
34d2382d93
commit
b80402fd65
@ -64,7 +64,9 @@ open class Image: Node {
|
|||||||
tag: tag
|
tag: tag
|
||||||
)
|
)
|
||||||
|
|
||||||
srcVar.onChange { _ in self.mImage = nil }
|
srcVar.onChange { [weak self] _ in
|
||||||
|
self?.mImage = nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public init(image: MImage, xAlign: Align = .min, yAlign: Align = .min, aspectRatio: AspectRatio = .none, w: Int = 0, h: Int = 0, place: Transform = Transform.identity, opaque: Bool = true, opacity: Double = 1, clip: Locus? = nil, effect: Effect? = nil, visible: Bool = true, tag: [String] = []) {
|
public init(image: MImage, xAlign: Align = .min, yAlign: Align = .min, aspectRatio: AspectRatio = .none, w: Int = 0, h: Int = 0, place: Transform = Transform.identity, opaque: Bool = true, opacity: Double = 1, clip: Locus? = nil, effect: Effect? = nil, visible: Bool = true, tag: [String] = []) {
|
||||||
@ -93,7 +95,9 @@ open class Image: Node {
|
|||||||
tag: tag
|
tag: tag
|
||||||
)
|
)
|
||||||
|
|
||||||
srcVar.onChange { _ in self.mImage = nil }
|
srcVar.onChange { [weak self] _ in
|
||||||
|
self?.mImage = nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override open var bounds: Rect? {
|
override open var bounds: Rect? {
|
||||||
|
Loading…
Reference in New Issue
Block a user