Bp4 doclose fix
Created by: lwan86
fixed the issue that data is flushed twice if deferred variables are not empty when calling DoClose() function
Created by: lwan86
fixed the issue that data is flushed twice if deferred variables are not empty when calling DoClose() function