WM: Fix a crash (assert) when creating a new window.

This happened when creating a window with the cursor over the timeline area.
I still don't know exactly what happened but for a reason batches were not
reset in this case.
This commit is contained in:
Clément Foucault 2018-04-10 17:41:30 +02:00
parent 3cfca15b50
commit 04e363376b
1 changed files with 5 additions and 0 deletions

View File

@ -640,6 +640,11 @@ static void wm_window_ghostwindow_add(wmWindowManager *wm, const char *title, wm
if (ghostwin) {
GHOST_RectangleHandle bounds;
/* XXX Fix crash when a new window is created.
* However this should be move somewhere else. (fclem) */
BLF_batch_reset();
gpu_batch_presets_reset();
win->gwnctx = GWN_context_create();
/* the new window has already been made drawable upon creation */