Check that wxImageList::Create() is not called more than once
Or at least not until Destroy() is called.
This commit is contained in:
@@ -32,6 +32,7 @@ public:
|
|||||||
// from icons), and the initial size of the list.
|
// from icons), and the initial size of the list.
|
||||||
wxImageList(int width, int height, bool mask = true, int initialCount = 1)
|
wxImageList(int width, int height, bool mask = true, int initialCount = 1)
|
||||||
{
|
{
|
||||||
|
m_hImageList = 0;
|
||||||
Create(width, height, mask, initialCount);
|
Create(width, height, mask, initialCount);
|
||||||
}
|
}
|
||||||
virtual ~wxImageList();
|
virtual ~wxImageList();
|
||||||
|
@@ -73,6 +73,8 @@ wxImageList::wxImageList()
|
|||||||
// Creates an image list
|
// Creates an image list
|
||||||
bool wxImageList::Create(int width, int height, bool mask, int initial)
|
bool wxImageList::Create(int width, int height, bool mask, int initial)
|
||||||
{
|
{
|
||||||
|
wxASSERT_MSG( m_hImageList == NULL, "Recreating existing wxImageList?" );
|
||||||
|
|
||||||
// Prevent from storing negative dimensions
|
// Prevent from storing negative dimensions
|
||||||
m_size = wxSize(wxMax(width, 0), wxMax(height, 0));
|
m_size = wxSize(wxMax(width, 0), wxMax(height, 0));
|
||||||
UINT flags = 0;
|
UINT flags = 0;
|
||||||
|
Reference in New Issue
Block a user