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);
|
currentClipRectangle = arsd.color.Rectangle(0, 0, window.width, window.height);
|
||||||
if(window.activeScreenPainter !is null) {
|
if(window.activeScreenPainter !is null) {
|
||||||
impl = window.activeScreenPainter;
|
impl = window.activeScreenPainter;
|
||||||
|
if(impl.referenceCount == 0) {
|
||||||
|
impl.window = window;
|
||||||
|
impl.create(handle);
|
||||||
|
}
|
||||||
impl.referenceCount++;
|
impl.referenceCount++;
|
||||||
// writeln("refcount ++ ", impl.referenceCount);
|
// writeln("refcount ++ ", impl.referenceCount);
|
||||||
} else {
|
} else {
|
||||||
|
@ -6227,7 +6231,7 @@ struct ScreenPainter {
|
||||||
if(impl.referenceCount == 0) {
|
if(impl.referenceCount == 0) {
|
||||||
//writeln("destructed");
|
//writeln("destructed");
|
||||||
impl.dispose();
|
impl.dispose();
|
||||||
window.activeScreenPainter = null;
|
*window.activeScreenPainter = ScreenPainterImplementation.init;
|
||||||
//import std.stdio; writeln("paint finished");
|
//import std.stdio; writeln("paint finished");
|
||||||
} else {
|
} else {
|
||||||
// there is still an active reference, reset stuff so the
|
// there is still an active reference, reset stuff so the
|
||||||
|
|
Loading…
Reference in New Issue