summaryrefslogtreecommitdiff
path: root/apps/gui/icon.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/icon.c')
-rw-r--r--apps/gui/icon.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/apps/gui/icon.c b/apps/gui/icon.c
index 9fe7090f4a..e78aa6841c 100644
--- a/apps/gui/icon.c
+++ b/apps/gui/icon.c
@@ -63,7 +63,6 @@ static struct iconset {
63 struct bitmap bmp; 63 struct bitmap bmp;
64 bool loaded; 64 bool loaded;
65 int handle; 65 int handle;
66 int handle_locked;
67} iconsets[Iconset_Count][NB_SCREENS]; 66} iconsets[Iconset_Count][NB_SCREENS];
68 67
69#define ICON_HEIGHT(screen) (!iconsets[Iconset_user][screen].loaded ? \ 68#define ICON_HEIGHT(screen) (!iconsets[Iconset_user][screen].loaded ? \
@@ -160,8 +159,6 @@ static int buflib_move_callback(int handle, void* current, void* new)
160 struct iconset *set = &iconsets[i][j]; 159 struct iconset *set = &iconsets[i][j];
161 if (set->bmp.data == current) 160 if (set->bmp.data == current)
162 { 161 {
163 if (set->handle_locked > 0)
164 return BUFLIB_CB_CANNOT_MOVE;
165 set->bmp.data = new; 162 set->bmp.data = new;
166 return BUFLIB_CB_OK; 163 return BUFLIB_CB_OK;
167 } 164 }
@@ -201,11 +198,10 @@ static void load_icons(const char* filename, enum Iconset iconset,
201 goto finished; 198 goto finished;
202 } 199 }
203 lseek(fd, 0, SEEK_SET); 200 lseek(fd, 0, SEEK_SET);
201 core_pin(ic->handle);
204 ic->bmp.data = core_get_data(ic->handle); 202 ic->bmp.data = core_get_data(ic->handle);
205
206 ic->handle_locked = 1;
207 size_read = read_bmp_fd(fd, &ic->bmp, buf_size, bmpformat, NULL); 203 size_read = read_bmp_fd(fd, &ic->bmp, buf_size, bmpformat, NULL);
208 ic->handle_locked = 0; 204 core_unpin(ic->handle);
209 205
210 if (size_read < 0) 206 if (size_read < 0)
211 { 207 {