fix crash when clearing dynamicfontdata, closes #4877

This commit is contained in:
Juan Linietsky 2016-06-13 22:24:11 -03:00
parent 64b4253dbf
commit 944c7e2603
2 changed files with 6 additions and 2 deletions

View File

@ -1844,7 +1844,7 @@ void Control::_propagate_theme_changed(CanvasItem *p_at,Control *p_owner) {
Control *c = p_at->cast_to<Control>();
if (c && c->data.theme.is_valid()) // has a theme, this can't be propagated
if (c && c!=p_owner && c->data.theme.is_valid()) // has a theme, this can't be propagated
return;
for(int i=0;i<p_at->get_child_count();i++) {

View File

@ -573,7 +573,11 @@ DynamicFontAtSize::~DynamicFontAtSize(){
void DynamicFont::set_font_data(const Ref<DynamicFontData>& p_data) {
data=p_data;
if (data.is_valid())
data_at_size=data->_get_dynamic_font_at_size(size);
else
data_at_size=Ref<DynamicFontAtSize>();
emit_changed();
}