Summary: | [iOS] The UIProcess may get killed for trying to stay runnable in the background for more than 30 seconds | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||
Component: | WebKit2 | Assignee: | Chris Dumez <cdumez> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | achristensen, beidson, commit-queue, ggaren, sihui_liu, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Chris Dumez
2019-04-29 13:55:51 PDT
Created attachment 368490 [details]
Patch
Comment on attachment 368490 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=368490&action=review > Source/WebKit/UIProcess/ios/ProcessAssertionIOS.mm:72 > + [self _updateBackgroundTask]; I think you need to capture a weak reference to self, otherwise you have a memory leak (the global Notification Center has a reference to self, and never goes away). Once that leak is fixed, don't we also need to unregister for this notification in our dealloc method? Comment on attachment 368490 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=368490&action=review >> Source/WebKit/UIProcess/ios/ProcessAssertionIOS.mm:72 >> + [self _updateBackgroundTask]; > > I think you need to capture a weak reference to self, otherwise you have a memory leak (the global Notification Center has a reference to self, and never goes away). > > Once that leak is fixed, don't we also need to unregister for this notification in our dealloc method? self is a static object though, so I would not expect the dealloc method to ever get called. Comment on attachment 368490 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=368490&action=review >>> Source/WebKit/UIProcess/ios/ProcessAssertionIOS.mm:72 >>> + [self _updateBackgroundTask]; >> >> I think you need to capture a weak reference to self, otherwise you have a memory leak (the global Notification Center has a reference to self, and never goes away). >> >> Once that leak is fixed, don't we also need to unregister for this notification in our dealloc method? > > self is a static object though, so I would not expect the dealloc method to ever get called. I mean that WKProcessAssertionBackgroundTaskManager (self) is a singleton, so "leaking" it is the expectation. Comment on attachment 368490 [details]
Patch
r=me
Comment on attachment 368490 [details] Patch Clearing flags on attachment: 368490 Committed r244761: <https://trac.webkit.org/changeset/244761> All reviewed patches have been landed. Closing bug. |