mirror of
https://github.com/DoubleLabyrinth/navicat-keygen.git
synced 2019-12-02 05:10:56 +00:00
Fix a mistake that will return an invalid pointer
This commit is contained in:
@@ -5,13 +5,15 @@
|
||||
class SystemError : public Exception {
|
||||
private:
|
||||
const std::error_code _ErrorCode;
|
||||
const std::string _ErrorString;
|
||||
public:
|
||||
SystemError(const char* FileName,
|
||||
int Line,
|
||||
unsigned long Code,
|
||||
const char* Message) noexcept :
|
||||
Exception(FileName, Line, Message),
|
||||
_ErrorCode(Code, std::system_category()) {}
|
||||
_ErrorCode(Code, std::system_category()),
|
||||
_ErrorString(_ErrorCode.message()) {}
|
||||
|
||||
virtual bool HasErrorCode() const noexcept override {
|
||||
return true;
|
||||
@@ -22,7 +24,7 @@ public:
|
||||
}
|
||||
|
||||
virtual const char* ErrorString() const noexcept override {
|
||||
return _ErrorCode.message().c_str();
|
||||
return _ErrorString.c_str();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user