Bindings: Viewport: Don't dispose children in RGSS2/3
This commit is contained in:
		
							parent
							
								
									1a489aafaf
								
							
						
					
					
						commit
						5549ff78f0
					
				
					 4 changed files with 16 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -27,8 +27,7 @@
 | 
			
		|||
 | 
			
		||||
/* 'Children' are disposables that are disposed together
 | 
			
		||||
 * with their parent. Currently this is only used by Viewport
 | 
			
		||||
 * in RGSS1.
 | 
			
		||||
 * FIXME: Disable this behavior when RGSS2 or 3 */
 | 
			
		||||
 * in RGSS1. */
 | 
			
		||||
inline void
 | 
			
		||||
disposableAddChild(VALUE disp, VALUE child)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -72,7 +71,8 @@ RB_METHOD(disposableDispose)
 | 
			
		|||
	if (d->isDisposed())
 | 
			
		||||
		return Qnil;
 | 
			
		||||
 | 
			
		||||
	disposableDisposeChildren(self);
 | 
			
		||||
	if (rgssVer == 1)
 | 
			
		||||
		disposableDisposeChildren(self);
 | 
			
		||||
 | 
			
		||||
	d->dispose();
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -100,7 +100,8 @@ static void disposableBindingInit(VALUE klass)
 | 
			
		|||
 | 
			
		||||
	/* Make sure we always have access to the original method, even
 | 
			
		||||
	 * if it is overridden by user scripts */
 | 
			
		||||
	rb_define_alias(klass, "_mkxp_dispose_alias", "dispose");
 | 
			
		||||
	if (rgssVer == 1)
 | 
			
		||||
		rb_define_alias(klass, "_mkxp_dispose_alias", "dispose");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template<class C>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -75,7 +75,9 @@ viewportElementInitialize(int argc, VALUE *argv, VALUE self)
 | 
			
		|||
	if (!NIL_P(viewportObj))
 | 
			
		||||
	{
 | 
			
		||||
		viewport = getPrivateDataCheck<Viewport>(viewportObj, ViewportType);
 | 
			
		||||
		disposableAddChild(viewportObj, self);
 | 
			
		||||
 | 
			
		||||
		if (rgssVer == 1)
 | 
			
		||||
			disposableAddChild(viewportObj, self);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* Construct object */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue