Destroy buffers of the specified window


#include <screen/screen.h>
int screen_destroy_window_buffers(screen_window_t win)


The handle of the window whose buffer(s) you want to destroy.




If win was created with screen_create_window_buffers() or a reference to win was created with screen_ref_window(), then the function type for screen_destroy_window_buffers() is flushing execution. Otherwise, the function type is immediate execution.

This function releases one or more buffers allocated for the specified window, without destroying the window. If buffers were created with screen_create_window_buffers(), the memory is released and can be used for other window or pixmap buffers. If buffers were attached using screen_attach_window_buffers(), these buffers are destroyed but no memory is actually released. In this case, the application is responsible for freeing the memory after calling screen_destroy_window_buffers(). The memory that is released by this call is not reserved and can be used for any subsequent buffer allocation by Screen.


0 if successful, or -1 if an error occurred (errno is set; refer to errno.h for more details).