summaryrefslogtreecommitdiff
path: root/src/image.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2019-05-18 17:44:16 +0300
committerEli Zaretskii <eliz@gnu.org>2019-05-18 17:44:16 +0300
commit721c520f36c151a738c47404b498672390139ada (patch)
treecaa08e28bd00693dde5885d153efe78cad31240e /src/image.c
parentb0a0705a4e46831020edb7336a765c50baa093ff (diff)
downloademacs-721c520f36c151a738c47404b498672390139ada.tar.gz
Fix display of images on MS-Windows broken by a recent commit
* src/image.c (initialize_image_type): Test if the type is in Vlibrary_cache up front, and return true without calling the 'init' method if the type was already initialized.
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/image.c b/src/image.c
index b82bf12aa5e..071b92a741e 100644
--- a/src/image.c
+++ b/src/image.c
@@ -9696,15 +9696,15 @@ static bool
initialize_image_type (struct image_type const *type)
{
#ifdef WINDOWSNT
- bool (*init) (void) = type->init;
+ Lisp_Object typesym = builtin_lisp_symbol (type->type);
+ Lisp_Object tested = Fassq (typesym, Vlibrary_cache);
+ /* If we failed to load the library before, don't try again. */
+ if (CONSP (tested))
+ return !NILP (XCDR (tested)) ? true : false;
+ bool (*init) (void) = type->init;
if (init)
{
- /* If we failed to load the library before, don't try again. */
- Lisp_Object typesym = builtin_lisp_symbol (type->type);
- Lisp_Object tested = Fassq (typesym, Vlibrary_cache);
- if (CONSP (tested) && NILP (XCDR (tested)))
- return false;
bool type_valid = init ();
Vlibrary_cache = Fcons (Fcons (typesym, type_valid ? Qt : Qnil),
Vlibrary_cache);