Releases all the objects used
| 631 | |
| 632 | // Releases all the objects used |
| 633 | void Xbox360Peripheral::ReleaseAll(void) |
| 634 | { |
| 635 | LockRequired locker(mainLock); |
| 636 | |
| 637 | SerialDisconnect(); |
| 638 | PadDisconnect(); |
| 639 | if (serialTimer != NULL) |
| 640 | { |
| 641 | serialTimer->cancelTimeout(); |
| 642 | getWorkLoop()->removeEventSource(serialTimer); |
| 643 | serialTimer->release(); |
| 644 | serialTimer = NULL; |
| 645 | } |
| 646 | if (serialInPipe != NULL) |
| 647 | { |
| 648 | serialInPipe->Abort(); |
| 649 | serialInPipe->release(); |
| 650 | serialInPipe = NULL; |
| 651 | } |
| 652 | if (serialInBuffer != NULL) |
| 653 | { |
| 654 | serialInBuffer->release(); |
| 655 | serialInBuffer = NULL; |
| 656 | } |
| 657 | if (serialIn != NULL) |
| 658 | { |
| 659 | serialIn->close(this); |
| 660 | serialIn = NULL; |
| 661 | } |
| 662 | if(outPipe!=NULL) { |
| 663 | outPipe->Abort(); |
| 664 | outPipe->release(); |
| 665 | outPipe=NULL; |
| 666 | } |
| 667 | if(inPipe!=NULL) { |
| 668 | inPipe->Abort(); |
| 669 | inPipe->release(); |
| 670 | inPipe=NULL; |
| 671 | } |
| 672 | if(inBuffer!=NULL) { |
| 673 | inBuffer->release(); |
| 674 | inBuffer=NULL; |
| 675 | } |
| 676 | if(interface!=NULL) { |
| 677 | interface->close(this); |
| 678 | interface=NULL; |
| 679 | } |
| 680 | if(device!=NULL) { |
| 681 | device->close(this); |
| 682 | device=NULL; |
| 683 | } |
| 684 | } |
| 685 | |
| 686 | // Handle termination |
| 687 | bool Xbox360Peripheral::didTerminate(IOService *provider, IOOptionBits options, bool *defer) |
nothing calls this directly
no outgoing calls
no test coverage detected