Skip to content

Commit feac16b

Browse files
committed
Fix for raii_guard being unable to print real error message.
1 parent b40179b commit feac16b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/xrScriptEngine/script_engine.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -505,13 +505,12 @@ struct raii_guard : private Noncopyable
505505
{
506506
CScriptEngine* scriptEngine;
507507
int m_error_code;
508-
const char* m_error_description;
508+
LPCSTR const& m_error_description;
509509

510-
raii_guard(CScriptEngine* scriptEngine, int error_code, const char* error_description)
510+
raii_guard(CScriptEngine* scriptEngine, int error_code, LPCSTR const& error_description)
511+
:m_error_code(error_code), m_error_description(error_description)
511512
{
512513
this->scriptEngine = scriptEngine;
513-
m_error_code = error_code;
514-
m_error_description = error_description;
515514
}
516515

517516
~raii_guard()

0 commit comments

Comments
 (0)