From bddbe16ea9180c4ddd6609fd2974b5ef83e01095 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 29 Jul 2015 13:43:54 -0400 Subject: [PATCH] Fixed some more runtime errors. --- redo/darwin/datetimepicker.m | 1 + redo/darwin/window.m | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/redo/darwin/datetimepicker.m b/redo/darwin/datetimepicker.m index 5d088409..330482e0 100644 --- a/redo/darwin/datetimepicker.m +++ b/redo/darwin/datetimepicker.m @@ -27,6 +27,7 @@ uiDateTimePicker *finishNewDateTimePicker(NSDatePickerElementFlags elements) [d->dp setDatePickerElements:elements]; [d->dp setDatePickerMode:NSSingleDateMode]; // TODO get date picker font + uiDarwinMakeSingleViewControl(uiControl(d), d->dp, YES); uiControl(d)->Handle = datetimepickerHandle; diff --git a/redo/darwin/window.m b/redo/darwin/window.m index 2ffa3b0c..ff2b8574 100644 --- a/redo/darwin/window.m +++ b/redo/darwin/window.m @@ -61,7 +61,8 @@ static void windowCommitDestroy(uiControl *c) [w->window orderOut:w->window]; // now destroy the child binSetChild(w->bin, NULL); - uiControlDestroy(w->child); + if (w->child != NULL) + uiControlDestroy(w->child); // now destroy the bin // we do this by changing the content view to a dummy view // the window will release its reference on the bin now, then it will release its reference on the dummy view when the window itself is finally released @@ -129,7 +130,8 @@ static void windowSetChild(uiWindow *ww, uiControl *child) { struct window *w = (struct window *) ww; - binSetChild(w->bin, child); + w->child = child; + binSetChild(w->bin, w->child); } static int windowMargined(uiWindow *ww)