fix crash when video renderer is deleted. close first
call qpainter.end() only if it is active