summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-04-30 20:25:46 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-04-30 20:25:46 +0000
commitae0a384dc2d35285f4d4b907695480f09f177f40 (patch)
treee96b81a05a5ad475699b9951b6a94d5451aea713 /plugins/Clist_modern
parentaf683f3f4196c45f130ba10a2d14e89a729b6e52 (diff)
crash fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@13322 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r--plugins/Clist_modern/src/hdr/modern_image_array.h5
-rw-r--r--plugins/Clist_modern/src/modern_image_array.cpp14
2 files changed, 9 insertions, 10 deletions
diff --git a/plugins/Clist_modern/src/hdr/modern_image_array.h b/plugins/Clist_modern/src/hdr/modern_image_array.h
index a5acd94588..00056edae0 100644
--- a/plugins/Clist_modern/src/hdr/modern_image_array.h
+++ b/plugins/Clist_modern/src/hdr/modern_image_array.h
@@ -49,10 +49,7 @@ struct IMAGE_ARRAY_DATA
HBITMAP img;
int width;
int height;
- void * lpBits;
-
- // CS
- mir_cs cs;
+ void *lpBits;
// Array
IMAGE_ARRAY_DATA_NODE *nodes;
diff --git a/plugins/Clist_modern/src/modern_image_array.cpp b/plugins/Clist_modern/src/modern_image_array.cpp
index 020c58a25b..9219e60712 100644
--- a/plugins/Clist_modern/src/modern_image_array.cpp
+++ b/plugins/Clist_modern/src/modern_image_array.cpp
@@ -28,6 +28,8 @@ Created by Pescuma
#include "hdr/modern_image_array.h"
#include "hdr/modern_commonprototypes.h"
+static mir_cs cs;
+
// To use this code in other places, replace the body of this func by the body of ske_CreateDIB32
static HBITMAP ImageArray_CreateBitmapPoint(int cx, int cy, void ** pt)
{
@@ -179,7 +181,7 @@ int ImageArray_AddImage(IMAGE_ARRAY_DATA *iad, HBITMAP hBmp, int pos)
if (hBmp == NULL)
return -1;
- mir_cslock lck(iad->cs);
+ mir_cslock lck(cs);
if (pos < 0)
pos = iad->nodes_size;
@@ -337,7 +339,7 @@ BOOL ImageArray_ChangeImage(IMAGE_ARRAY_DATA *iad, HBITMAP hBmp, int pos)
if (pos >= iad->nodes_size)
return FALSE;
- mir_cslock lck(iad->cs);
+ mir_cslock lck(cs);
// Get bounds
if (!GetObject(hBmp, sizeof(BITMAP), &bm))
@@ -467,7 +469,7 @@ BOOL ImageArray_RemoveImage(IMAGE_ARRAY_DATA *iad, int pos)
if (pos >= iad->nodes_size)
return FALSE;
- mir_cslock lck(iad->cs);
+ mir_cslock lck(cs);
// Get bounds
if (iad->width_based) {
@@ -577,7 +579,7 @@ BOOL ImageArray_DrawImage(IMAGE_ARRAY_DATA *iad, int pos, HDC hdcDest, int nXDes
if (hdcDest == NULL || pos < 0 || pos >= iad->nodes_size)
return FALSE;
- mir_cslock lck(iad->cs);
+ mir_cslock lck(cs);
{
int w, h, i;
@@ -603,9 +605,9 @@ BOOL ImageArray_DrawImage(IMAGE_ARRAY_DATA *iad, int pos, HDC hdcDest, int nXDes
return FALSE;
}
-BOOL ImageArray_GetImageSize(IMAGE_ARRAY_DATA *iad, int pos, SIZE * lpSize)
+BOOL ImageArray_GetImageSize(IMAGE_ARRAY_DATA *iad, int pos, SIZE *lpSize)
{
- mir_cslock lck(iad->cs);
+ mir_cslock lck(cs);
if (lpSize) {
lpSize->cx = iad->nodes[pos].width;
lpSize->cy = iad->nodes[pos].height;