Null deref fixes / cleanups
This commit is contained in:
		
							parent
							
								
									1737ec9af4
								
							
						
					
					
						commit
						2226927b08
					
				
					 3 changed files with 23 additions and 13 deletions
				
			
		| 
						 | 
				
			
			@ -105,10 +105,12 @@ void Plane::setBitmap(Bitmap *value)
 | 
			
		|||
{
 | 
			
		||||
	GUARD_DISPOSED;
 | 
			
		||||
 | 
			
		||||
	if (value)
 | 
			
		||||
		value->ensureNonMega();
 | 
			
		||||
 | 
			
		||||
	p->bitmap = value;
 | 
			
		||||
 | 
			
		||||
	if (!value)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	value->ensureNonMega();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Plane::setOX(int value)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -152,10 +152,13 @@ void Sprite::setBitmap(Bitmap *bitmap)
 | 
			
		|||
	if (p->bitmap == bitmap)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	if (bitmap)
 | 
			
		||||
		bitmap->ensureNonMega();
 | 
			
		||||
 | 
			
		||||
	p->bitmap = bitmap;
 | 
			
		||||
 | 
			
		||||
	if (!bitmap)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	bitmap->ensureNonMega();
 | 
			
		||||
 | 
			
		||||
	*p->srcRect = bitmap->rect();
 | 
			
		||||
	p->onSrcRectChange();
 | 
			
		||||
	p->quad.setPosRect(p->srcRect->toFloatRect());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -717,24 +717,29 @@ void Window::setWindowskin(Bitmap *value)
 | 
			
		|||
{
 | 
			
		||||
	GUARD_DISPOSED;
 | 
			
		||||
 | 
			
		||||
	if (value)
 | 
			
		||||
		value->ensureNonMega();
 | 
			
		||||
 | 
			
		||||
	p->windowskin = value;
 | 
			
		||||
 | 
			
		||||
	if (!value)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	value->ensureNonMega();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Window::setContents(Bitmap *value)
 | 
			
		||||
{
 | 
			
		||||
	GUARD_DISPOSED;
 | 
			
		||||
 | 
			
		||||
	if (value)
 | 
			
		||||
		value->ensureNonMega();
 | 
			
		||||
	if (p->contents == value)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	p->contents = value;
 | 
			
		||||
	p->controlsVertDirty = true;
 | 
			
		||||
 | 
			
		||||
	if (value)
 | 
			
		||||
		p->contentsQuad.setTexPosRect(value->rect(), value->rect());
 | 
			
		||||
	if (!value)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	value->ensureNonMega();
 | 
			
		||||
	p->contentsQuad.setTexPosRect(value->rect(), value->rect());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Window::setStretch(bool value)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue