Fixed some more runtime errors.

This commit is contained in:
Pietro Gagliardi 2015-07-29 13:43:54 -04:00
parent 10eefc7a61
commit bddbe16ea9
2 changed files with 5 additions and 2 deletions

View File

@ -27,6 +27,7 @@ uiDateTimePicker *finishNewDateTimePicker(NSDatePickerElementFlags elements)
[d->dp setDatePickerElements:elements]; [d->dp setDatePickerElements:elements];
[d->dp setDatePickerMode:NSSingleDateMode]; [d->dp setDatePickerMode:NSSingleDateMode];
// TODO get date picker font // TODO get date picker font
uiDarwinMakeSingleViewControl(uiControl(d), d->dp, YES);
uiControl(d)->Handle = datetimepickerHandle; uiControl(d)->Handle = datetimepickerHandle;

View File

@ -61,7 +61,8 @@ static void windowCommitDestroy(uiControl *c)
[w->window orderOut:w->window]; [w->window orderOut:w->window];
// now destroy the child // now destroy the child
binSetChild(w->bin, NULL); binSetChild(w->bin, NULL);
uiControlDestroy(w->child); if (w->child != NULL)
uiControlDestroy(w->child);
// now destroy the bin // now destroy the bin
// we do this by changing the content view to a dummy view // 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 // 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; struct window *w = (struct window *) ww;
binSetChild(w->bin, child); w->child = child;
binSetChild(w->bin, w->child);
} }
static int windowMargined(uiWindow *ww) static int windowMargined(uiWindow *ww)