for (int i=0; i<columnCount; i++) { TreeColumn column = columns [i]; if (!column.isDisposed ()) column.releaseResources ();
if (columns != null) { for (int i=0; i<columnCount; i++) { TreeColumn column = columns [i]; if (!column.isDisposed ()) column.releaseResources (); }
void releaseWidget () {	int columnCount = OS.SendMessage (hwndHeader, OS.HDM_GETITEMCOUNT, 0, 0);	for (int i=0; i<items.length; i++) {		TreeItem item = items [i];		if (item != null && !item.isDisposed ()) {			item.releaseResources ();		}	}	items = null;	for (int i=0; i<columnCount; i++) {		TreeColumn column = columns [i];		if (!column.isDisposed ()) column.releaseResources ();	}	columns = null;	/*	* Feature in Windows.  For some reason, when TVM_GETIMAGELIST	* or TVM_SETIMAGELIST is sent, the tree issues NM_CUSTOMDRAW	* messages.  This behavior is unwanted when the tree is being	* disposed.  The fix is to ingore NM_CUSTOMDRAW messages by	* clearing the custom draw flag.	* 	* NOTE: This only happens on Windows XP.	*/	customDraw = false;	if (imageList != null) {		OS.SendMessage (handle, OS.TVM_SETIMAGELIST, OS.TVSIL_NORMAL, 0);		display.releaseImageList (imageList);	}	if (headerImageList != null) {		if (hwndHeader != 0) {			OS.SendMessage (hwndHeader, OS.HDM_SETIMAGELIST, 0, 0);		}		display.releaseImageList (headerImageList);	}	imageList = headerImageList = null;	int hStateList = OS.SendMessage (handle, OS.TVM_GETIMAGELIST, OS.TVSIL_STATE, 0);	OS.SendMessage (handle, OS.TVM_SETIMAGELIST, OS.TVSIL_STATE, 0);	if (hStateList != 0) OS.ImageList_Destroy (hStateList);	super.releaseWidget ();}