* Make sure Shutdown() can be called more than once (ie. reset the members as

needed).
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36210 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2010-04-13 12:23:01 +00:00
parent 2e7bd0169f
commit f735ce7d79

View File

@ -1,5 +1,5 @@
/*
* Copyright 2001-2009, Haiku.
* Copyright 2001-2010, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -9,6 +9,7 @@
* Axel Dörfler, axeld@pinc-software.de
*/
/*! Accelerant based HWInterface implementation */
@ -400,18 +401,24 @@ AccelerantHWInterface::_SetupDefaultHooks()
status_t
AccelerantHWInterface::Shutdown()
{
if (fAccelerantHook) {
uninit_accelerant UninitAccelerant
if (fAccelerantHook != NULL) {
uninit_accelerant uninitAccelerant
= (uninit_accelerant)fAccelerantHook(B_UNINIT_ACCELERANT, NULL);
if (UninitAccelerant)
UninitAccelerant();
if (uninitAccelerant != NULL)
uninitAccelerant();
fAccelerantHook = NULL;
}
if (fAccelerantImage >= 0)
if (fAccelerantImage >= 0) {
unload_add_on(fAccelerantImage);
fAccelerantImage = -1;
}
if (fCardFD >= 0)
if (fCardFD >= 0) {
close(fCardFD);
fCardFD = -1;
}
return B_OK;
}