<commit_before>/*
 * MelonJS Game Engine
 * Copyright (C) 2011 - 2013, <NAME>
 * http://www.melonjs.org
 *
 */

(function($) {

	/**
	 * a default loading screen
	 * @memberOf me
	 * @ignore
	 * @constructor
	 */
	me.DefaultLoadingScreen = me.ScreenObject.extend({
		/*---
		
			constructor
			
			---*/
		init : function() {
			this.parent(true);

			// flag to know if we need to refresh the display
			this.invalidate = false;

			// handle for the susbcribe function
			this.handle = null;
			
			// generated from /src/loader/logo.png
			this.imgLogo = new Image();
			this.imgLogo.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABVCAMAAACIGrFuAAADAFBMVEXu7u7t7e37+/v39/f4+Pjp6en7+/v7+/v////r6+v09PTs7Oz4+Pju7u7f39/19fX39/fs7Oz09PTr6+v6+vrx8fH09PT5+fn6+vrs7Oz5+fnw8PDy8vL////4+Pj6+vqZmZnt7e3z8/Pt7e3x8fHq6ury8vL////t7e34+Pju7u7////u7u7t7e3w8PDz7/P/zP/w8PDw8PD6+vr9/f3r6+vt7e3u7u739/f29vb19fXs7Ozw8PD29vb4+fjr6+u5ubn6+vr7+/v////x8fHw8PD////q6ur7+/ny8vL39/fw8PD29vb////39/fp6en09PTr6+v39/ft7e3////////6+vr6+vrs7Oz4+Pj////39/<KEY>";
		
			this.barHeight = 4;
		},

		// call when the loader is resetted
		onResetEvent : function() {
			// melonJS logo
			this.logo1 = new me.Font('century gothic', 32, 'white', 'middle');
			this.logo2 = new me.Font('century gothic', 32, '#55aa00', 'middle');
			this.logo2.bold();
			this.logo1.textBaseline = this.logo2.textBaseline = "alphabetic";

			// setup a callback
			this.handle = me.event.subscribe(me.event.LOADER_PROGRESS, this.onProgressUpdate.bind(this));

			// load progress in percent
			this.loadPercent = 0;
		},
		
		// destroy object at end of loading
		onDestroyEvent : function() {
			// "nullify" all fonts
			this.logo1 = this.logo2 = null;
			// cancel the callback
			if (this.handle)  {
				me.event.unsubscribe(this.handle);
				this.handle = null;
			}
		},

		// make sure the screen is refreshed every frame 
		onProgressUpdate : function(progress) {
			this.loadPercent = progress;
			this.invalidate = true;
		},

		// make sure the screen is refreshed every frame 
		update : function() {<commit_msg>fixed the loader image asse not being properly deallocated or reallocated (if called multiple times)<commit_after>/*
 * MelonJS Game Engine
 * Copyright (C) 2011 - 2013, <NAME>
 * http://www.melonjs.org
 *
 */

(function($) {

	/**
	 * a default loading screen
	 * @memberOf me
	 * @ignore
	 * @constructor
	 */
	me.DefaultLoadingScreen = me.ScreenObject.extend({
		/*---
		
			constructor
			
			---*/
		init : function() {
			this.parent(true);

			// flag to know if we need to refresh the display
			this.invalidate = false;

			// handle for the susbcribe function
			this.handle = null;
			
		},

		// call when the loader is resetted
		onResetEvent : function() {
			// melonJS logo
			this.logo1 = new me.Font('century gothic', 32, 'white', 'middle');
			this.logo2 = new me.Font('century gothic', 32, '#55aa00', 'middle');
			this.logo2.bold();
			this.logo1.textBaseline = this.logo2.textBaseline = "alphabetic";

			// generated from /src/loader/logo.png
			this.imgLogo = new Image();
			this.imgLogo.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABVCAMAAACIGrFuAAADAFBMVEXu7u7t7e37+/v39/f4+Pjp6en7+/v7+/v////r6+v09PTs7Oz4+Pju7u7f39/19fX39/fs7Oz09PTr6+v6+vrx8fH09PT5+fn6+vrs7Oz5+fnw8PDy8vL////4+<KEY>";
		
			// default progress bar height
			this.barHeight = 4;

			// setup a callback
			this.handle = me.event.subscribe(me.event.LOADER_PROGRESS, this.onProgressUpdate.bind(this));

			// load progress in percent
			this.loadPercent = 0;
		},
		
		// destroy object at end of loading
		onDestroyEvent : function() {
			// "nullify" all fonts
			this.logo1 = this.logo2 = null;
			// cancel the callback
			if (this.handle)  {
				me.event.unsubscribe(this.handle);
				this.handle = null;
			}
			// free the Image ressource
			if (this.imgLogo && (typeof(this.imgLogo.dispose) === 'function')) {
				// cocoonJS extension
				this.imgLogo.dispose();
			} 
			delete this.imgLogo;
		},

		// make sure the screen is refreshed every frame 
		onProgressUpdate : function(progress) {
			this.loadPercent = progress;
			this.invalidate = true;
		},

		// make sure the screen is refreshed every frame 
		update : function() {
{'fraction_non_alphanumeric': 0.14224952741020794, 'fraction_numerical': 0.048440453686200376, 'mean_word_length': 3.078034682080925, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4483564', 'n_tokens_mistral': 1902, 'n_tokens_neox': 1583, 'n_words': 311}