Aric Stewart aric@codeweavers.com writes:
@@ -1121,6 +1188,24 @@ static void get_font_properties(struct dwrite_font *font, HDC hdc) } }
+static HRESULT create_font_from_data(struct dwrite_font_data *data, IDWriteFont **font) +{
- HRESULT hr;
- struct dwrite_font *This;
- hr = create_font_base(font);
- if (FAILED(hr))
return hr;
- This = impl_from_IDWriteFont(*font);
- heap_free(This->data);
- This->data = data;
- InterlockedIncrement(&This->data->ref);
- return S_OK;
+}
That looks unnecessarily complicated. Why allocate and initialize the data only to immediately replace it?