	module test_module
	
	implicit none

		type :: data_type
		end type data_type

		type,public :: blah
						
			!character(len=10000)		:: a = ''		!note: destroy routine crashes if 
			!integer,dimension(100,100)	:: b = 0		! these variable are uncommented
			
			class(data_type), allocatable :: data
		
		end type blah

	contains
	
		!*********************************
		subroutine destroy(p)
		implicit none
		
		type(blah),pointer :: p
				
		deallocate(p)
						
		end subroutine destroy
		!*********************************
	
		!*********************************
		subroutine memory_leak()
		implicit none
		
		type(blah),pointer :: p
				
		allocate(p)
		
		!
		! do stuff with p...
		!
				
		!deallocate(p)	!no leak
		
		call destroy(p)	!leak
				
		end subroutine memory_leak
		!*********************************

	end module test_module
	
	program test
	
		use test_module
	
		integer :: i
	
		i=0
		do 
		
			i=i+1
		
			write(*,*) i
		
			call memory_leak()
		
		end do
		
	end program test