summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine/skin_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/skin_engine/skin_parser.c')
-rw-r--r--apps/gui/skin_engine/skin_parser.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index 047c4735a0..2eef2af7c0 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -1870,13 +1870,11 @@ static void skin_data_reset(struct wps_data *wps_data)
1870} 1870}
1871 1871
1872#ifndef __PCTOOL__ 1872#ifndef __PCTOOL__
1873static int currently_loading_handle = -1;
1874static int buflib_move_callback(int handle, void* current, void* new) 1873static int buflib_move_callback(int handle, void* current, void* new)
1875{ 1874{
1875 (void)handle;
1876 (void)current; 1876 (void)current;
1877 (void)new; 1877 (void)new;
1878 if (handle == currently_loading_handle)
1879 return BUFLIB_CB_CANNOT_MOVE;
1880 /* Any active skins may be scrolling - which means using viewports which 1878 /* Any active skins may be scrolling - which means using viewports which
1881 * will be moved after this callback returns. This is a hammer to make that 1879 * will be moved after this callback returns. This is a hammer to make that
1882 * safe. TODO: use a screwdriver instead. 1880 * safe. TODO: use a screwdriver instead.
@@ -1890,14 +1888,6 @@ static int buflib_move_callback(int handle, void* current, void* new)
1890 return BUFLIB_CB_OK; 1888 return BUFLIB_CB_OK;
1891} 1889}
1892static struct buflib_callbacks buflib_ops = {buflib_move_callback, NULL, NULL}; 1890static struct buflib_callbacks buflib_ops = {buflib_move_callback, NULL, NULL};
1893static void lock_handle(int handle)
1894{
1895 currently_loading_handle = handle;
1896}
1897static void unlock_handle(void)
1898{
1899 currently_loading_handle = -1;
1900}
1901#endif 1891#endif
1902 1892
1903static int load_skin_bmp(struct wps_data *wps_data, struct bitmap *bitmap, char* bmpdir) 1893static int load_skin_bmp(struct wps_data *wps_data, struct bitmap *bitmap, char* bmpdir)
@@ -1944,12 +1934,12 @@ static int load_skin_bmp(struct wps_data *wps_data, struct bitmap *bitmap, char*
1944 _stats->buflib_handles++; 1934 _stats->buflib_handles++;
1945 _stats->images_size += buf_size; 1935 _stats->images_size += buf_size;
1946 lseek(fd, 0, SEEK_SET); 1936 lseek(fd, 0, SEEK_SET);
1947 lock_handle(handle); 1937 core_pin(handle);
1948 bitmap->data = core_get_data(handle); 1938 bitmap->data = core_get_data(handle);
1949 int ret = read_bmp_fd(fd, bitmap, buf_size, format, NULL); 1939 int ret = read_bmp_fd(fd, bitmap, buf_size, format, NULL);
1950 bitmap->data = NULL; /* do this to force a crash later if the 1940 bitmap->data = NULL; /* do this to force a crash later if the
1951 caller doesnt call core_get_data() */ 1941 caller doesnt call core_get_data() */
1952 unlock_handle(); 1942 core_unpin(handle);
1953 close(fd); 1943 close(fd);
1954 if (ret > 0) 1944 if (ret > 0)
1955 { 1945 {