destroy Parent when child is destroyed

hey guys i wanna know how to destroy a parent when the child is destroyed , thanks !

This should work:

function OnDestroy () {
	Destroy(transform.parent.gameObject);
}

woow. i was searching this solution thank you maan.