mirror of https://github.com/adamdruppe/arsd.git
remove GC from potentially per-frame call
This commit is contained in:
parent
03885f286c
commit
f9442ead2a
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue