prevent memory leak from mistake in doublebuffer code