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

What is the issue with the setConfig method in the Database.swift file? #1235

Open
funnyJackChen opened this issue Oct 29, 2024 · 1 comment

Comments

@funnyJackChen
Copy link

The language of WCDB

Swift

The version of WCDB

e.g. v2.1.9

The platform of WCDB

iOS

The installation of WCDB

Cocoapods

What's the issue?

func setConfig(named name: String,
                   withInvocation invocation: @escaping Config,
                   withUninvocation uninvocation: Config? = nil,
                   withPriority priority: ConfigPriority = ConfigPriority.default) {
        let cppInvocation: @convention(c) (UnsafeMutableRawPointer, CPPHandle) -> Bool 

In the current method, the invocationBlock creates a Handle(withCPPHandle: cppHandle, database: self) which strongly references self, leading to the database not being released.

@Qiuwen-chen
Copy link
Collaborator

get

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

No branches or pull requests

2 participants