Changeset - r20522:f59a7a990690
[Not reviewed]
master
0 2 0
rubidium - 11 years ago 2013-06-30 20:40:49
rubidium@openttd.org
(svn r25546) -Fix: two small memory leaks
2 files changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/script/script_scanner.cpp
Show inline comments
 
@@ -67,24 +67,25 @@ void ScriptScanner::Initialize(const cha
 

	
 
	this->RegisterAPI(this->engine);
 
	this->RescanDir();
 

	
 
	this->engine->ResetCrashed();
 
}
 

	
 
ScriptScanner::~ScriptScanner()
 
{
 
	this->Reset();
 

	
 
	free(this->main_script);
 
	free(this->tar_file);
 
	delete this->engine;
 
}
 

	
 
void ScriptScanner::RescanDir()
 
{
 
	/* Forget about older scans */
 
	this->Reset();
 

	
 
	/* Scan for scripts */
 
	this->Scan(this->GetFileName(), this->GetDirectory());
 
}
 

	
src/viewport.cpp
Show inline comments
 
@@ -156,24 +156,27 @@ bool _draw_dirty_blocks = false;
 
uint _dirty_block_colour = 0;
 

	
 
static Point MapXYZToViewport(const ViewPort *vp, int x, int y, int z)
 
{
 
	Point p = RemapCoords(x, y, z);
 
	p.x -= vp->virtual_width / 2;
 
	p.y -= vp->virtual_height / 2;
 
	return p;
 
}
 

	
 
void DeleteWindowViewport(Window *w)
 
{
 
	if (w->viewport == NULL) return;
 

	
 
	delete w->viewport->overlay;
 
	free(w->viewport);
 
	w->viewport = NULL;
 
}
 

	
 
/**
 
 * Initialize viewport of the window for use.
 
 * @param w Window to use/display the viewport in
 
 * @param x Offset of left edge of viewport with respect to left edge window \a w
 
 * @param y Offset of top edge of viewport with respect to top edge window \a w
 
 * @param width Width of the viewport
 
 * @param height Height of the viewport
 
 * @param follow_flags Flags controlling the viewport.
0 comments (0 inline, 0 general)