Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

app crashes when on ios when using tns-core-modules/application in worker thread #7288

Copy link
Copy link
Open
@patricklx

Description

@patricklx
Issue body actions

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: v5.4.0
  • Cross-platform modules:
  • Android Runtime:
  • iOS Runtime: v5.4.0
  • Plugin(s):

Describe the bug
When using application in worker thread, the app might crash when the worker is terminating and the application is sending a notification at the same time.
This is because NSNotificationCenter calls the observer from the main thread, and calls the function in the worker thread, while its deallocating the observer. Which then causes invalid memory access and then crashes.

relevant code lines:
https://github.com/NativeScript/NativeScript/blob/master/tns-core-modules/application/application.ios.ts#L86
https://github.com/NativeScript/NativeScript/blob/master/tns-core-modules/application/application.ios.ts#L122

To Reproduce

Expected behavior
application should unregister the observers on dealloc. Or another generic way to know which observers where added in the worker thread and remove them.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    🆕 New
    Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.