Skip to content

[webview_flutter_wkwebview] Bump pigeon and re-run generator #9284

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Autogenerated from Pigeon (v25.3.0), do not edit directly.
// Autogenerated from Pigeon (v25.3.2), do not edit directly.
// See also: https://pub.dev/packages/pigeon

import Foundation
Expand Down Expand Up @@ -86,12 +86,12 @@ protocol WebKitLibraryPigeonInternalFinalizerDelegate: AnyObject {

// Attaches to an object to receive a callback when the object is deallocated.
internal final class WebKitLibraryPigeonInternalFinalizer {
private static let associatedObjectKey = malloc(1)!
internal static let associatedObjectKey = malloc(1)!

private let identifier: Int64
// Reference to the delegate is weak because the callback should be ignored if the
// `InstanceManager` is deallocated.
private weak var delegate: WebKitLibraryPigeonInternalFinalizerDelegate?
internal weak var delegate: WebKitLibraryPigeonInternalFinalizerDelegate?

private init(identifier: Int64, delegate: WebKitLibraryPigeonInternalFinalizerDelegate) {
self.identifier = identifier
Expand All @@ -107,7 +107,13 @@ internal final class WebKitLibraryPigeonInternalFinalizer {
}

static func detach(from instance: AnyObject) {
objc_setAssociatedObject(instance, associatedObjectKey, nil, .OBJC_ASSOCIATION_ASSIGN)
let finalizer =
objc_getAssociatedObject(instance, associatedObjectKey)
as? WebKitLibraryPigeonInternalFinalizer
if let finalizer = finalizer {
finalizer.delegate = nil
objc_setAssociatedObject(instance, associatedObjectKey, nil, .OBJC_ASSOCIATION_ASSIGN)
}
}

deinit {
Expand Down Expand Up @@ -265,6 +271,10 @@ final class WebKitLibraryPigeonInstanceManager {
/// The manager will be empty after this call returns.
func removeAllObjects() throws {
lockQueue.sync {
let weakInstancesEnumerator = weakInstances.objectEnumerator()!
while let instance = weakInstancesEnumerator.nextObject() {
WebKitLibraryPigeonInternalFinalizer.detach(from: instance as AnyObject)
}
identifiers.removeAllObjects()
weakInstances.removeAllObjects()
strongInstances.removeAllObjects()
Expand Down
Loading