D1137: Unclosed Command List

A command list was referenced that had either not been populated or had not been unset from the device context.

 

Possible Causes

This message may occur during an attempt to draw or stream a command list before its ID2D1CommandList::Close operation was called. Direct2D does not consider a command list to be valid until it has been populated; using the Close method indicates that a command list is finished being populated. If the application will use the command list for a drawing operation, the device context it uses must not have the command list set as its target.

Possible Fixes

Before attempting to use a command list, call its ID2D1CommandList::Close method. If the command list will be drawn using ID2D1DeviceContext::DrawImage or as the source of an image brush, ensure that the command list is not the current target of the corresponding device context.