remove GC from potentially per-frame call

This commit is contained in:
Adam D. Ruppe 2019-04-03 09:56:43 -04:00
parent 03885f286c
commit f9442ead2a
1 changed files with 5 additions and 1 deletions

View File

@ -6196,6 +6196,10 @@ struct ScreenPainter {
currentClipRectangle = arsd.color.Rectangle(0, 0, window.width, window.height);
if(window.activeScreenPainter !is null) {
impl = window.activeScreenPainter;
if(impl.referenceCount == 0) {
impl.window = window;
impl.create(handle);
}
impl.referenceCount++;
// writeln("refcount ++ ", impl.referenceCount);
} else {
@ -6227,7 +6231,7 @@ struct ScreenPainter {
if(impl.referenceCount == 0) {
//writeln("destructed");
impl.dispose();
window.activeScreenPainter = null;
*window.activeScreenPainter = ScreenPainterImplementation.init;
//import std.stdio; writeln("paint finished");
} else {
// there is still an active reference, reset stuff so the