浏览代码

scene: fix multiple crashes in release mode and a few warnings.

In release mode our asserts are ignored for performance reasons and all
the code they may be executing is disabled, so no side effects will happen.
We can’t put programming logic in asserts.
undefined
Sam Hocevar 9 年前
父节点
当前提交
d9f2b07822
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. +1
    -0
      src/input/controller.h
  2. +2
    -1
      src/sys/threadbase.h

+ 1
- 0
src/input/controller.h 查看文件

@@ -343,6 +343,7 @@ public:
case InputType::JoystickKey:/***/*this << InputProfile::JoystickKey/***/(joy, (int)i, T((int)i).ToString()); break;
case InputType::MouseAxis:/*****/*this << InputProfile::MouseAxis/*****/(/***/(int)i, T((int)i).ToString()); break;
case InputType::JoystickAxis:/**/*this << InputProfile::JoystickAxis/**/(joy, (int)i, T((int)i).ToString()); break;
default: break;
}
}
}


+ 2
- 1
src/sys/threadbase.h 查看文件

@@ -81,11 +81,12 @@ public:
#endif
}

//Will not block if another thread has already locked ---------------------
// Will not block if another thread has already locked ---------------------
bool try_lock()
{
#if !defined(LOL_FEATURE_THREADS) || !LOL_FEATURE_THREADS
/* Nothing */
return false;
#elif LOL_FEATURE_CXX11_THREADS
return m_mutex.try_lock();
#elif defined HAVE_PTHREAD_H


正在加载...
取消
保存