* Fixed a bug in get_interface() that would return the first interface
without acquiring a reference to it, and thus led to bug #6565. * Added a commented out function that dumps all current reference counts. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38867 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -85,6 +85,22 @@ static AddressTable sAddressTable;
|
|||||||
static uint32 sInterfaceIndex;
|
static uint32 sInterfaceIndex;
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
//! For debugging purposes only
|
||||||
|
void
|
||||||
|
dump_interface_refs(void)
|
||||||
|
{
|
||||||
|
MutexLocker locker(sLock);
|
||||||
|
|
||||||
|
InterfaceList::Iterator iterator = sInterfaces.GetIterator();
|
||||||
|
while (Interface* interface = iterator.Next()) {
|
||||||
|
dprintf("%p: %s, %ld\n", interface, interface->name,
|
||||||
|
interface->CountReferences());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if ENABLE_DEBUGGER_COMMANDS
|
#if ENABLE_DEBUGGER_COMMANDS
|
||||||
|
|
||||||
|
|
||||||
@@ -1345,10 +1361,11 @@ get_interface(net_domain* domain, uint32 index)
|
|||||||
{
|
{
|
||||||
MutexLocker locker(sLock);
|
MutexLocker locker(sLock);
|
||||||
|
|
||||||
|
Interface* interface;
|
||||||
if (index == 0)
|
if (index == 0)
|
||||||
return sInterfaces.First();
|
interface = sInterfaces.First();
|
||||||
|
else
|
||||||
Interface* interface = find_interface(index);
|
interface = find_interface(index);
|
||||||
if (interface == NULL)
|
if (interface == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user