1
0
Fork 0

add manual uninstall functions for callback/io-handler objects

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3721
This commit is contained in:
Sebastian Strohhäcker 2011-06-17 14:28:00 +00:00
parent 039e32658a
commit f1d85a3739
4 changed files with 19 additions and 3 deletions

View file

@ -118,11 +118,15 @@ void IO_ReadHandleObject::Install(Bitu port,IO_ReadHandler * handler,Bitu mask,B
} else E_Exit("IO_readHandler allready installed port %x",port);
}
IO_ReadHandleObject::~IO_ReadHandleObject(){
void IO_ReadHandleObject::Uninstall(){
if(!installed) return;
IO_FreeReadHandler(m_port,m_mask,m_range);
}
IO_ReadHandleObject::~IO_ReadHandleObject(){
Uninstall();
}
void IO_WriteHandleObject::Install(Bitu port,IO_WriteHandler * handler,Bitu mask,Bitu range) {
if(!installed) {
installed=true;
@ -133,9 +137,13 @@ void IO_WriteHandleObject::Install(Bitu port,IO_WriteHandler * handler,Bitu mask
} else E_Exit("IO_writeHandler allready installed port %x",port);
}
IO_WriteHandleObject::~IO_WriteHandleObject(){
void IO_WriteHandleObject::Uninstall() {
if(!installed) return;
IO_FreeWriteHandler(m_port,m_mask,m_range);
}
IO_WriteHandleObject::~IO_WriteHandleObject(){
Uninstall();
//LOG_MSG("FreeWritehandler called with port %X",m_port);
}