Does anyone know why, whenever I put in "pcap_freealldevs(devs);" into
my cleanup code (that frees all the memory, etc...that my program
uses), it always crashes?<br>
<br>
devs declaration:<br>
pcap_if_t *devs, *d; // Device list<br>
<br>
My cleanup code:<br>
void CDevice::Cleanup(){<br>
<br>
// Free the device list<br>
pcap_freealldevs(devs);<br>
}<br>
<br>
and how I'm using devs:<br>
void CDevice::Devices(){<br>
if(pcap_findalldevs(&devs, error) == -1){<br>
AfxMessageBox(error);<br>
} else{<br>
for(iCount = 0, d = devs; d != NULL; d = d->next, iCount++){<br>
if(d->description){<br>
cDescription[iCount] = d->description;<br>
}<br>
<br>
cDevice[iCount] = d->name;<br>
}<br>
}<br>
}<br>
<br>
I've been racking my brain for over an hour trying to figure out what I'm doing.<br>
<br>
(Note: I call Cleanup() in the WM_DESTROY Windows message)<br>