@@ -162,125 +162,150 @@ extern "C-unwind" fn accepts_first_mouse(_this: &NSView, _sel: Sel, _event: &NSE
162162}
163163
164164extern "C-unwind" fn become_first_responder < V : ViewImpl > ( this : & View < V > , _sel : Sel ) -> Bool {
165- V :: become_first_responder ( this. inner_ref ( ) ) . into ( )
165+ let Some ( inner) = this. inner_ref ( ) else { return false . into ( ) } ;
166+ V :: become_first_responder ( inner) . into ( )
166167}
167168
168169extern "C-unwind" fn resign_first_responder < V : ViewImpl > ( this : & View < V > , _sel : Sel ) -> Bool {
169- V :: resign_first_responder ( this. inner_ref ( ) ) . into ( )
170+ let Some ( inner) = this. inner_ref ( ) else { return true . into ( ) } ;
171+ V :: resign_first_responder ( inner) . into ( )
170172}
171173
172174extern "C-unwind" fn window_should_close < V : ViewImpl > (
173175 this : & View < V > , _: Sel , _sender : & AnyObject ,
174176) -> Bool {
175- V :: window_should_close ( this. inner_ref ( ) ) . into ( )
177+ let Some ( inner) = this. inner_ref ( ) else { return true . into ( ) } ;
178+ V :: window_should_close ( inner) . into ( )
176179}
177180
178181extern "C-unwind" fn view_did_change_backing_properties < V : ViewImpl > (
179182 this : & View < V > , _: Sel , _: & AnyObject ,
180183) {
181- V :: view_did_change_backing_properties ( this. inner_ref ( ) ) ;
184+ let Some ( inner) = this. inner_ref ( ) else { return } ;
185+ V :: view_did_change_backing_properties ( inner) ;
182186}
183187
184188extern "C-unwind" fn hit_test < V : ViewImpl > (
185189 this : & View < V > , _sel : Sel , point : NSPoint ,
186190) -> Option < & NSView > {
187- V :: hit_test ( this. inner_ref ( ) , point)
191+ V :: hit_test ( this. inner_ref ( ) ? , point)
188192}
189193
190194extern "C-unwind" fn view_will_move_to_window < V : ViewImpl > (
191195 this : & View < V > , _self : Sel , new_window : Option < & NSWindow > ,
192196) {
193- V :: view_will_move_to_window ( this. inner_ref ( ) , new_window) ;
197+ let Some ( inner) = this. inner_ref ( ) else { return } ;
198+ V :: view_will_move_to_window ( inner, new_window) ;
194199}
195200
196201extern "C-unwind" fn update_tracking_areas < V : ViewImpl > ( this : & View < V > , _self : Sel , _: & AnyObject ) {
197- V :: update_tracking_areas ( this. inner_ref ( ) ) ;
202+ let Some ( inner) = this. inner_ref ( ) else { return } ;
203+ V :: update_tracking_areas ( inner) ;
198204}
199205
200206extern "C-unwind" fn mouse_moved < V : ViewImpl > ( this : & View < V > , _sel : Sel , event : & NSEvent ) {
201- V :: mouse_moved ( this. inner_ref ( ) , event) ;
207+ let Some ( inner) = this. inner_ref ( ) else { return } ;
208+ V :: mouse_moved ( inner, event) ;
202209}
203210
204211extern "C-unwind" fn scroll_wheel < V : ViewImpl > ( this : & View < V > , _: Sel , event : & NSEvent ) {
205- V :: scroll_wheel ( this. inner_ref ( ) , event) ;
212+ let Some ( inner) = this. inner_ref ( ) else { return } ;
213+ V :: scroll_wheel ( inner, event) ;
206214}
207215
208216extern "C-unwind" fn dragging_entered < V : ViewImpl > (
209217 this : & View < V > , _sel : Sel , sender : Option < & ProtocolObject < dyn NSDraggingInfo > > ,
210218) -> NSDragOperation {
211- V :: dragging_entered ( this. inner_ref ( ) , sender)
219+ let Some ( inner) = this. inner_ref ( ) else { return NSDragOperation :: None } ;
220+ V :: dragging_entered ( inner, sender)
212221}
213222
214223extern "C-unwind" fn dragging_updated < V : ViewImpl > (
215224 this : & View < V > , _sel : Sel , sender : Option < & ProtocolObject < dyn NSDraggingInfo > > ,
216225) -> NSDragOperation {
217- V :: dragging_updated ( this. inner_ref ( ) , sender)
226+ let Some ( inner) = this. inner_ref ( ) else { return NSDragOperation :: None } ;
227+ V :: dragging_updated ( inner, sender)
218228}
219229
220230extern "C-unwind" fn prepare_for_drag_operation < V : ViewImpl > (
221231 this : & View < V > , _sel : Sel , sender : Option < & ProtocolObject < dyn NSDraggingInfo > > ,
222232) -> Bool {
223- V :: prepare_for_drag_operation ( this. inner_ref ( ) , sender) . into ( )
233+ let Some ( inner) = this. inner_ref ( ) else { return false . into ( ) } ;
234+ V :: prepare_for_drag_operation ( inner, sender) . into ( )
224235}
225236
226237extern "C-unwind" fn perform_drag_operation < V : ViewImpl > (
227238 this : & View < V > , _sel : Sel , sender : Option < & ProtocolObject < dyn NSDraggingInfo > > ,
228239) -> Bool {
229- V :: perform_drag_operation ( this. inner_ref ( ) , sender) . into ( )
240+ let Some ( inner) = this. inner_ref ( ) else { return false . into ( ) } ;
241+ V :: perform_drag_operation ( inner, sender) . into ( )
230242}
231243
232244extern "C-unwind" fn dragging_exited < V : ViewImpl > (
233245 this : & View < V > , _sel : Sel , sender : Option < & ProtocolObject < dyn NSDraggingInfo > > ,
234246) {
235- V :: dragging_exited ( this. inner_ref ( ) , sender)
247+ let Some ( inner) = this. inner_ref ( ) else { return } ;
248+ V :: dragging_exited ( inner, sender)
236249}
237250
238251extern "C-unwind" fn handle_notification < V : ViewImpl > (
239252 this : & View < V > , _cmd : Sel , notification : & NSNotification ,
240253) {
241- V :: handle_notification ( this. inner_ref ( ) , notification)
254+ let Some ( inner) = this. inner_ref ( ) else { return } ;
255+ V :: handle_notification ( inner, notification)
242256}
243257
244258extern "C-unwind" fn mouse_entered < V : ViewImpl > ( this : & View < V > , _: Sel , _: & AnyObject ) {
245- V :: mouse_entered ( this. inner_ref ( ) ) ;
259+ let Some ( inner) = this. inner_ref ( ) else { return } ;
260+ V :: mouse_entered ( inner) ;
246261}
247262
248263extern "C-unwind" fn mouse_exited < V : ViewImpl > ( this : & View < V > , _: Sel , _: & AnyObject ) {
249- V :: mouse_exited ( this. inner_ref ( ) ) ;
264+ let Some ( inner) = this. inner_ref ( ) else { return } ;
265+ V :: mouse_exited ( inner) ;
250266}
251267
252268extern "C-unwind" fn key_down < V : ViewImpl > ( this : & View < V > , _: Sel , event : & NSEvent ) {
253- V :: key_down ( this. inner_ref ( ) , event) ;
269+ let Some ( inner) = this. inner_ref ( ) else { return } ;
270+ V :: key_down ( inner, event) ;
254271}
255272
256273extern "C-unwind" fn key_up < V : ViewImpl > ( this : & View < V > , _: Sel , event : & NSEvent ) {
257- V :: key_up ( this. inner_ref ( ) , event) ;
274+ let Some ( inner) = this. inner_ref ( ) else { return } ;
275+ V :: key_up ( inner, event) ;
258276}
259277
260278extern "C-unwind" fn flags_changed < V : ViewImpl > ( this : & View < V > , _: Sel , event : & NSEvent ) {
261- V :: flags_changed ( this. inner_ref ( ) , event) ;
279+ let Some ( inner) = this. inner_ref ( ) else { return } ;
280+ V :: flags_changed ( inner, event) ;
262281}
263282
264283extern "C-unwind" fn mouse_down < V : ViewImpl > ( this : & View < V > , _sel : Sel , event : & NSEvent ) {
265- V :: mouse_down ( this. inner_ref ( ) , event) ;
284+ let Some ( inner) = this. inner_ref ( ) else { return } ;
285+ V :: mouse_down ( inner, event) ;
266286}
267287
268288extern "C-unwind" fn mouse_up < V : ViewImpl > ( this : & View < V > , _sel : Sel , event : & NSEvent ) {
269- V :: mouse_up ( this. inner_ref ( ) , event) ;
289+ let Some ( inner) = this. inner_ref ( ) else { return } ;
290+ V :: mouse_up ( inner, event) ;
270291}
271292
272293extern "C-unwind" fn right_mouse_down < V : ViewImpl > ( this : & View < V > , _sel : Sel , event : & NSEvent ) {
273- V :: right_mouse_down ( this. inner_ref ( ) , event) ;
294+ let Some ( inner) = this. inner_ref ( ) else { return } ;
295+ V :: right_mouse_down ( inner, event) ;
274296}
275297
276298extern "C-unwind" fn right_mouse_up < V : ViewImpl > ( this : & View < V > , _sel : Sel , event : & NSEvent ) {
277- V :: right_mouse_up ( this. inner_ref ( ) , event) ;
299+ let Some ( inner) = this. inner_ref ( ) else { return } ;
300+ V :: right_mouse_up ( inner, event) ;
278301}
279302
280303extern "C-unwind" fn other_mouse_down < V : ViewImpl > ( this : & View < V > , _sel : Sel , event : & NSEvent ) {
281- V :: other_mouse_down ( this. inner_ref ( ) , event) ;
304+ let Some ( inner) = this. inner_ref ( ) else { return } ;
305+ V :: other_mouse_down ( inner, event) ;
282306}
283307
284308extern "C-unwind" fn other_mouse_up < V : ViewImpl > ( this : & View < V > , _sel : Sel , event : & NSEvent ) {
285- V :: other_mouse_up ( this. inner_ref ( ) , event) ;
309+ let Some ( inner) = this. inner_ref ( ) else { return } ;
310+ V :: other_mouse_up ( inner, event) ;
286311}
0 commit comments