Fix an error of 'Object has been destroyed' 71/260271/5
authorDongHyun Song <dh81.song@samsung.com>
Wed, 23 Jun 2021 02:21:55 +0000 (11:21 +0900)
committerDongHyun Song <dh81.song@samsung.com>
Wed, 23 Jun 2021 07:15:36 +0000 (16:15 +0900)
commitf62edda184d65f902c5801528ed7c082d0b90556
tree08a3905fb5a06d287ac5d03fa2723e8dcb12b25e
parent6636fc32479e2d0884f4d0a7e555340f8c256aad
Fix an error of 'Object has been destroyed'

When app is terminate by SIGTERM or tizen.application...exit(),
There comes a TypeError 'Object has been destroyed'

suspend() will be called again on quit() for backgroun-runnable
apps, but since this.mainWindow can be already destroyed, below
code can throw exception with destroyed object 'this.mainWindow'
 - addonManager.emit('lcSuspend', this.mainWindow.id);

It is enough to call setEnable() for suspending (if window is alive)

Change-Id: Ie2e99cf74ca412902e4456901dc8350f038e3067
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
wrt_app/src/web_application.ts