Refcount
Signed-off-by: somebody_master <somebody_master@somebodyserver.mooo.com>
This commit is contained in:
		@@ -1,9 +1,23 @@
 | 
				
			|||||||
#include "test.hpp"
 | 
					#include "test.hpp"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <godot_cpp/variant/utility_functions.hpp>
 | 
					#include <godot_cpp/variant/utility_functions.hpp>
 | 
				
			||||||
 | 
					#include <godot_cpp/variant/variant.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <godot_cpp/classes/image_texture.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void Test::start_test() {
 | 
					void Test::start_test() {
 | 
				
			||||||
	UtilityFunctions::print("Hello world form GDExtension");
 | 
						Ref<ImageTexture> tex(memnew(ImageTexture));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						auto format = tex->get_format();
 | 
				
			||||||
 | 
						UtilityFunctions::print(tex->get_reference_count());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						Ref<ImageTexture> tex2 = tex;
 | 
				
			||||||
 | 
						UtilityFunctions::print(tex->get_reference_count());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						tex2.unref();
 | 
				
			||||||
 | 
						UtilityFunctions::print(tex->get_reference_count());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						tex.unref();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void Test::_bind_methods() {
 | 
					void Test::_bind_methods() {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user