def METHOD_NAME(self):
    if self.closed:
        return
    # We do not set self._native_context = None here because this causes
    # trouble in case a canvas is closed multiple times (as in
    # app.test_run()). The problem occurs in gloo's glir._gl_initialize
    # when it tries to call glGetString(GL_VERSION).
    # But OSMesa requires a context to be attached when calling
    # glGetString otherwise it returns an empty string, which gloo doesn't
    # like
    self._closed = True
    return