1
0
Fork 0
baseview/src
glowcoil 9fbfe18f9a
NSView lifetime fixes (#104)
* drain autorelease pools in Window::open_* methods

* fixes to NSView lifetime logic:

- in open_parented and open_blocking, release NSView after adding
  it as a subview of the parent
- in open_blocking, don't call autorelease on NSWindow. previously
  it was a no-op, but now that we are actually draining our
  autorelease pools, it ends up prematurely releasing the window.

* fixes to NSView cleanup logic:

- Move retainCount check to before calling [super release].
  If [super release] happens first, then in the final call to
  release, [super release] deallocates the object and the call to
  retainCount results in a segfault.

- Move objc_disposeClassPair to dealloc. Previously we were
  calling it when retainCount == 1, but that's exactly when
  dealloc is called, so this is cleaner. Also, we need to call
  objc_disposeClassPair after [super dealloc].

NOTE: The circular-reference-breaking logic in release is
definitely broken. It's easy to thwart it by e.g. creating a
wgpu surface at some point after build() or dropping one at some
point before drop(). Need to come up with a better solution.
2021-11-07 16:57:12 -06:00
..
macos NSView lifetime fixes (#104) 2021-11-07 16:57:12 -06:00
win add scrollwheel support for windows 2021-10-09 16:52:56 -07:00
x11 typo 2021-07-14 11:45:06 -05:00
event.rs Derive Clone, Copy, PartialEq for EventStatus and WindowScalePolicy 2021-02-10 17:01:49 +01:00
keyboard.rs Use keyboard-types types directly instead of druid wrappers 2020-11-14 17:46:12 +01:00
lib.rs separate Window::open() into three functions (parented, as_if_parented, and blocking) 2021-01-01 22:52:59 -06:00
mouse_cursor.rs fix Windows build 2020-10-20 17:04:37 -05:00
window.rs Support passing back some events to the platform (#90) 2021-02-09 14:47:31 -06:00
window_info.rs fix Windows build 2020-10-20 17:04:37 -05:00
window_open_options.rs Derive Clone, Copy, PartialEq for EventStatus and WindowScalePolicy 2021-02-10 17:01:49 +01:00