mirror of https://github.com/PCSX2/pcsx2.git
cdvdgigaherz: Use unique_ptr for src
This commit is contained in:
parent
f8f79788e4
commit
d872c0560a
|
@ -123,7 +123,7 @@ std::atomic<bool> s_keepalive_is_open;
|
|||
bool disc_has_changed = false;
|
||||
bool weAreInNewDiskCB = false;
|
||||
|
||||
IOCtlSrc *src;
|
||||
std::unique_ptr<IOCtlSrc> src;
|
||||
|
||||
char throwaway[2352];
|
||||
extern s32 prefetch_last_lba;
|
||||
|
@ -203,7 +203,7 @@ s32 CALLBACK CDVDopen(const char *pTitleFilename)
|
|||
|
||||
// open device file
|
||||
try {
|
||||
src = new IOCtlSrc(drive);
|
||||
src = std::unique_ptr<IOCtlSrc>(new IOCtlSrc(drive));
|
||||
} catch (std::runtime_error &ex) {
|
||||
fputs(ex.what(), stdout);
|
||||
return -1;
|
||||
|
@ -221,8 +221,7 @@ void CALLBACK CDVDclose()
|
|||
StopKeepAliveThread();
|
||||
cdvdStopThread();
|
||||
//close device
|
||||
delete src;
|
||||
src = NULL;
|
||||
src.reset();
|
||||
}
|
||||
|
||||
void CALLBACK CDVDshutdown()
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
@ -83,7 +84,7 @@ public:
|
|||
bool DiscReady();
|
||||
};
|
||||
|
||||
extern IOCtlSrc *src;
|
||||
extern std::unique_ptr<IOCtlSrc> src;
|
||||
|
||||
void configure();
|
||||
|
||||
|
|
Loading…
Reference in New Issue