浏览代码

1.20 + ordering issue fix, so I can tag this for 1.5.4

rdb 17 年之前
父节点
当前提交
addb68b630
共有 1 个文件被更改,包括 1 次插入12 次删除
  1. 1 12
      panda/src/pgui/pgButton.cxx

+ 1 - 12
panda/src/pgui/pgButton.cxx

@@ -69,7 +69,6 @@ PGButton(const PGButton &copy) :
 ////////////////////////////////////////////////////////////////////
 PandaNode *PGButton::
 make_copy() const {
-  LightReMutexHolder holder(_lock);
   return new PGButton(*this);
 }
 
@@ -81,7 +80,6 @@ make_copy() const {
 ////////////////////////////////////////////////////////////////////
 void PGButton::
 enter_region(const MouseWatcherParameter &param) {
-  LightReMutexHolder holder(_lock);
   if (get_active()) {
     set_state(_button_down ? S_depressed : S_rollover);
   }
@@ -96,7 +94,6 @@ enter_region(const MouseWatcherParameter &param) {
 ////////////////////////////////////////////////////////////////////
 void PGButton::
 exit_region(const MouseWatcherParameter &param) {
-  LightReMutexHolder holder(_lock);
   if (get_active()) {
     set_state(S_ready);
   }
@@ -112,7 +109,6 @@ exit_region(const MouseWatcherParameter &param) {
 ////////////////////////////////////////////////////////////////////
 void PGButton::
 press(const MouseWatcherParameter &param, bool background) {
-  LightReMutexHolder holder(_lock);
   if (has_click_button(param.get_button())) {
     if (get_active()) {
       _button_down = true;
@@ -131,7 +127,6 @@ press(const MouseWatcherParameter &param, bool background) {
 ////////////////////////////////////////////////////////////////////
 void PGButton::
 release(const MouseWatcherParameter &param, bool background) {
-  LightReMutexHolder holder(_lock);
   if (has_click_button(param.get_button())) {
     _button_down = false;
     if (get_active()) {
@@ -154,7 +149,6 @@ release(const MouseWatcherParameter &param, bool background) {
 ////////////////////////////////////////////////////////////////////
 void PGButton::
 click(const MouseWatcherParameter &param) {
-  LightReMutexHolder holder(_lock);
   PGMouseWatcherParameter *ep = new PGMouseWatcherParameter(param);
   string event = get_click_event(param.get_button());
   play_sound(event);
@@ -176,7 +170,6 @@ click(const MouseWatcherParameter &param) {
 ////////////////////////////////////////////////////////////////////
 void PGButton::
 setup(const string &label, float bevel) {
-  LightReMutexHolder holder(_lock);
   clear_state_def(S_ready);
   clear_state_def(S_depressed);
   clear_state_def(S_rollover);
@@ -233,7 +226,6 @@ setup(const string &label, float bevel) {
 void PGButton::
 setup(const NodePath &ready, const NodePath &depressed, 
       const NodePath &rollover, const NodePath &inactive) {
-  LightReMutexHolder holder(_lock);
   clear_state_def(S_ready);
   clear_state_def(S_depressed);
   clear_state_def(S_rollover);
@@ -254,7 +246,6 @@ setup(const NodePath &ready, const NodePath &depressed,
 ////////////////////////////////////////////////////////////////////
 void PGButton:: 
 set_active(bool active) {
-  LightReMutexHolder holder(_lock);
   if (active != get_active()) {
     PGItem::set_active(active);
     set_state(active ? S_ready : S_inactive);
@@ -271,7 +262,6 @@ set_active(bool active) {
 ////////////////////////////////////////////////////////////////////
 bool PGButton::
 add_click_button(const ButtonHandle &button) {
-  LightReMutexHolder holder(_lock);
   return _click_buttons.insert(button).second;
 }
 
@@ -286,7 +276,6 @@ add_click_button(const ButtonHandle &button) {
 ////////////////////////////////////////////////////////////////////
 bool PGButton::
 remove_click_button(const ButtonHandle &button) {
-  LightReMutexHolder holder(_lock);
   return (_click_buttons.erase(button) != 0);
 }
 
@@ -299,6 +288,6 @@ remove_click_button(const ButtonHandle &button) {
 ////////////////////////////////////////////////////////////////////
 bool PGButton::
 has_click_button(const ButtonHandle &button) {
-  LightReMutexHolder holder(_lock);
   return (_click_buttons.count(button) != 0);
 }
+