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

startImageTask causing memory issue and crashing the app #798

Open
jcbriones opened this issue Jul 24, 2024 · 2 comments
Open

startImageTask causing memory issue and crashing the app #798

jcbriones opened this issue Jul 24, 2024 · 2 comments

Comments

@jcbriones
Copy link

This function is crashing the app. Not sure what has changed but there's a lot of crashes from time to time with the following function

   private func makeStartedImageTask(with request: ImageRequest, isDataTask: Bool = false, onEvent: ((ImageTask.Event, ImageTask) -> Void)? = nil) -> ImageTask {
        let task = ImageTask(taskId: nextTaskId, request: request, isDataTask: isDataTask, pipeline: self, onEvent: onEvent)
        // Important to call it before `imageTaskStartCalled`
        if !isDataTask {
            delegate.imageTaskCreated(task, pipeline: self)
        }
        task._task = Task {
            try await withUnsafeThrowingContinuation { continuation in
                self.queue.async {
                    task._continuation = continuation
                    self.startImageTask(task, isDataTask: isDataTask)
                }
            }
        }
        return task
    }
@kean
Copy link
Owner

kean commented Jul 25, 2024

Hey, could you please share a bit more details, including a crash log and the OS version.

@jcbriones
Copy link
Author

I'll send it over once I got more details as well.

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

No branches or pull requests

2 participants