Skip to content
Merged
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Unreleased

- macOS: Fix memory leak in `Surface`.

# Version 0.30.0-beta.1 (2022-09-03)

- Replace `winit` dependency with `raw-window-handle`.
Expand Down
4 changes: 2 additions & 2 deletions glutin/src/api/cgl/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl Display {
let inner = Arc::new(ConfigInner {
display: self.clone(),
raw: NSOpenGLPixelFormatId(raw),
transrarency: template.transparency,
transparency: template.transparency,
});
let config = Config { inner };

Expand Down Expand Up @@ -193,7 +193,7 @@ impl Sealed for Config {}

pub(crate) struct ConfigInner {
display: Display,
pub(crate) transrarency: bool,
pub(crate) transparency: bool,
pub(crate) raw: NSOpenGLPixelFormatId,
}

Expand Down
2 changes: 1 addition & 1 deletion glutin/src/api/cgl/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl Display {
let raw = NSOpenGLContext::alloc(nil)
.initWithFormat_shareContext_(*config.inner.raw, share_context as *mut _);

if config.inner.transrarency {
if config.inner.transparency {
let opacity = 0;
super::check_error(CGLSetParameter(
raw.CGLContextObj().cast(),
Expand Down
2 changes: 1 addition & 1 deletion glutin/src/api/cgl/surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl<T: SurfaceTypeTrait> Drop for Surface<T> {
fn drop(&mut self) {
unsafe {
if self.ns_view != nil {
let _: () = msg_send![self.ns_view, retain];
let _: () = msg_send![self.ns_view, release];
}
}
}
Expand Down