From 29336cb02be94fb2ab9659bc7a6f38cbcf9e82d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 22 Aug 2008 08:35:22 +0000 Subject: [PATCH] * Most modules were never unloaded due to a bug in put_module(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27133 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/module.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/system/kernel/module.cpp b/src/system/kernel/module.cpp index 736a930b33..3f34f0dbdd 100644 --- a/src/system/kernel/module.cpp +++ b/src/system/kernel/module.cpp @@ -2104,8 +2104,7 @@ get_module(const char* path, module_info** _info) status = B_OK; if (status == B_OK) { - if (module->ref_count < 0) - panic("argl %s", path); + ASSERT(module->ref_count >= 0); module->ref_count++; *_info = module->info; } else if ((module->flags & B_BUILT_IN_MODULE) == 0 @@ -2138,7 +2137,8 @@ put_module(const char* path) if ((module->flags & B_KEEP_LOADED) == 0) { if (--module->ref_count == 0) uninit_module(module); - } else if ((module->flags & B_BUILT_IN_MODULE) == 0) + } + if ((module->flags & B_BUILT_IN_MODULE) == 0) put_module_image(module->module_image); return B_OK;