Skip to content
Open
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
42 changes: 22 additions & 20 deletions src/mac.m
Original file line number Diff line number Diff line change
Expand Up @@ -1445,6 +1445,10 @@ - (void)windowDidExitFullScreen:(NSNotification*)notification
PuglStatus
puglUnrealize(PuglView* const view)
{
if (!view) {
return PUGL_FAILURE;
}

PuglInternals* const impl = view->impl;
if (!impl || !impl->wrapperView) {
return PUGL_FAILURE;
Expand All @@ -1457,6 +1461,19 @@ - (void)windowDidExitFullScreen:(NSNotification*)notification
}

if (impl->wrapperView) {
if (impl->wrapperView->trackingArea != nil) {
[impl->wrapperView removeTrackingArea:impl->wrapperView->trackingArea];
[impl->wrapperView->trackingArea release];
}

if(impl->wrapperView->userTimers != nil) {
[impl->wrapperView->userTimers release];
}

if(impl->wrapperView->markedText != nil) {
[impl->wrapperView->markedText release];
}

[impl->wrapperView removeFromSuperview];
}

Expand All @@ -1470,6 +1487,10 @@ - (void)windowDidExitFullScreen:(NSNotification*)notification
}

if (impl->window) {
if(((NSWindow*)impl->window).delegate != nil)
{
[((NSWindow*)impl->window).delegate release];
}
[impl->window release];
impl->window = NULL;
}
Expand Down Expand Up @@ -1518,28 +1539,9 @@ - (void)windowDidExitFullScreen:(NSNotification*)notification
puglFreeViewInternals(PuglView* view)
{
if (view) {
if (view->backend) {
view->backend->destroy(view);
}
puglUnrealize(view);

if (view->impl) {
if (view->impl->wrapperView) {
[view->impl->wrapperView removeFromSuperview];
view->impl->wrapperView->puglview = NULL;
}

if (view->impl->window) {
[view->impl->window close];
}

if (view->impl->wrapperView) {
[view->impl->wrapperView release];
}

if (view->impl->window) {
[view->impl->window release];
}

free(view->impl);
}
}
Expand Down