Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leak on iOS shared core helper #247

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

r-rebacz
Copy link

@r-rebacz r-rebacz commented Jul 30, 2024

Description

This PR fixes memory leak in one of iOS shared core helpers, whenever user defaults do not contain messages object.

Screenshot 2024-07-18 at 14 30 45
Screenshot 2024-07-18 at 14 30 38

How to reproduce

  • linphone lib integrated with iOS app.
  • Shared linphone core initialised with configuration:
       let config = Config.newForSharedCore(
                   appGroupId: ...,
                   configFilename: ...,
                   factoryConfigFilename: ...
       )

        do {
            core = try Factory.Instance.createSharedCoreWithConfig(
                config: config,
                systemContext: nil,
                appGroupId: ...,
                mainCore: true
            )
        }  catch {
            return nil
        }
  • Run the app.
  • Put a breakpoint right after core initialization. Open Xcodes object graph debugger. Turn on "leaked objects" filter.

How fix works

I think code is self explanatory :) It's all about missing release() call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants