Skip to content

[Bug]: macOS backend leaks objects in wake_on_fd_write #31755

Closed

Description

@iccir

Bug summary

Assuming that #31751 is fixed, the macOS backend will still leak an NSFileHandle and opaque NSObject created in wake_on_fd_write.

Code for reproduction

import matplotlib.pyplot as plt
plt.subplots()
plt.show()

Actual outcome

A call to wake_on_fd_write() creates an NSFileHandle and an _NSObserver, but these are never freed after the observation block executes.

Expected outcome

After the NSFileHandleDataAvailableNotification executes the specified block, both objects should be freed.

Additional information

No response

Operating system

macOS 14.7

Matplotlib Version

0.2.0.dev54528+unknown.gf4cf12592.d20260526

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

None

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions