apps_startup() needs a corresponding apps_shutdown().
authorRichard Levitte <levitte@openssl.org>
Sat, 23 Jun 2001 16:31:41 +0000 (16:31 +0000)
committerRichard Levitte <levitte@openssl.org>
Sat, 23 Jun 2001 16:31:41 +0000 (16:31 +0000)
apps/apps.h
apps/openssl.c

index 7f3903478ff4211a3a057fd6162cd50173b6f178..34935bde4232f4063f403a33b1ff382908e06b89 100644 (file)
@@ -116,26 +116,30 @@ extern BIO *bio_err;
 #endif
 
 #if defined(MONOLITH) && !defined(OPENSSL_C)
-#  define apps_startup()       do_pipe_sig()
+#  define apps_startup() \
+               do_pipe_sig()
+#  define apps_shutdown()
 #else
 #  if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WIN16) || \
    defined(OPENSSL_SYS_WIN32)
 #    ifdef _O_BINARY
 #      define apps_startup() \
-               _fmode=_O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
+               do { _fmode=_O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
                OpenSSL_add_all_algorithms(); ENGINE_load_builtin_engines(); \
-                setup_ui_method();
+                setup_ui_method(); } while(0)
 #    else
 #      define apps_startup() \
-               _fmode=O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
+               do { _fmode=O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \
                OpenSSL_add_all_algorithms(); ENGINE_load_builtin_engines(); \
-                setup_ui_method();
+                setup_ui_method(); } while(0)
 #    endif
 #  else
 #    define apps_startup() \
-               do_pipe_sig(); OpenSSL_add_all_algorithms(); \
-               ENGINE_load_builtin_engines(); setup_ui_method();
+               do { do_pipe_sig(); OpenSSL_add_all_algorithms(); \
+               ENGINE_load_builtin_engines(); setup_ui_method(); } while(0)
 #  endif
+#  define apps_shutdown() \
+               destroy_ui_method()
 #endif
 
 typedef struct args_st
index 3b4374a0488dd933482e731fb63a0bb34f8b93a7..22bd52ffed2c0d1f628de25e1396b7ae73761d46 100644 (file)
@@ -350,7 +350,8 @@ end:
        ERR_free_strings();
        
         ENGINE_cleanup();
-       destroy_ui_method();
+
+       apps_shutdown();
 
        CRYPTO_mem_leaks(bio_err);
        if (bio_err != NULL)