Tiny fix for SVGKImage observer leak: "...instance of SVGKImage is being deallocated while key value observers are still registered..."
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- objective-c
- Domain
- desktop-dev, mobile-dev
Research direction
Open SVGKImage.m and inspect the dealloc function, especially the observer cleanup immediately before [super dealloc]. Confirm that the DomTree.viewport observer is removed there, then verify that the reported deallocation warnings or crashes no longer occur.
Written by the indexing model from the issue text.
Description
Hi guys,
Thanks for your wonderful work on SVGKit.
Here's a tiny fix:
Currently the SVGKImage doesn't remove it's observers during dealloc, which causes warnings, or crashes (under certain scenarios).
All that needs to be done to fix it is to add the following line in SVGKImage.m, in the dealloc function, right above [super dealloc];
[self removeObserver:self forKeyPath:@"DomTree.viewport" context:nil];
and that should solve the problem. Hope this helps someone.
Ivan.
- Dominant language
- Objective-C
- Stars
- 4.6k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SVGKit/SVGKit
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Releases Open
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
name collision Open
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
noah-nuebling/mac-mouse-fix#2054 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
obsproject/obs-studio#13918 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
SwiftOldDriver/iOS-Weekly#5439 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100