remove whitespace at eol
[goodguy/history.git] / cinelerra-5.1 / cinelerra / garbage.C
index 654473592c31dd302a6a41f80173d6eea149e7fe..027754df5224871732a63f06617187fe19833508 100644 (file)
@@ -2,21 +2,21 @@
 /*
  * CINELERRA
  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
- * 
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- * 
+ *
  */
 
 #include "bcsignals.h"
@@ -41,8 +41,8 @@ Garbage::Garbage(const char *title)
 Garbage::~Garbage()
 {
        if(!deleted)
-               printf("Garbage::~Garbage: title=%s users=%d was not deleted by Garbage::remove_user\n", 
-                       title, 
+               printf("Garbage::~Garbage: title=%s users=%d was not deleted by Garbage::remove_user\n",
+                       title,
                        users);
        delete [] title;
        delete lock;
@@ -58,7 +58,8 @@ void Garbage::add_user()
 
 int Garbage::remove_user()
 {
-       if(!this) return 0;
+       void *This = this;
+       if(!This) return 0;
 
 //printf("Garbage::remove_user %d lock=%p users=%d\n", __LINE__, lock, users);
        if(users <= 0) {
@@ -95,39 +96,39 @@ int Garbage::remove_user()
 // {
 //     lock = new Mutex("Garbage::lock", 1);
 // }
-// 
-// 
+//
+//
 // Garbage::~Garbage()
 // {
 //     delete lock;
 // }
-// 
+//
 // // void Garbage::add_object(GarbageObject *ptr)
 // // {
 // //  lock->lock("Garbage::add_object");
 // //  objects.append(ptr);
 // //  lock->unlock();
 // // }
-// 
+//
 // void Garbage::delete_object(GarbageObject *ptr)
 // {
 //     if(!ptr) return;
-// 
+//
 //     Garbage *garbage = Garbage::garbage;
 //     garbage->lock->lock("Garbage::delete_object");
 //     ptr->users--;
-//     
+//
 //     if(ptr->users <= 0)
 //     {
 //             ptr->deleted = 1;
 //             delete ptr;
-// 
+//
 // // Remove expired objects here
 // //          remove_expired();
 //     }
 //     garbage->lock->unlock();
 // }
-// 
+//
 // void Garbage::remove_expired()
 // {
 //     Garbage *garbage = Garbage::garbage;
@@ -139,7 +140,7 @@ int Garbage::remove_user()
 // // Must remove pointer to prevent recursive deletion of the same object.
 // // But i is still invalid.
 //                     garbage->objects.remove_number(i);
-// 
+//
 //                     delete ptr;
 //                     i--;
 //             }