[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/impl.cpp server/ref_coun...
From: |
Markus Gothe |
Subject: |
[Gnash-commit] gnash ChangeLog server/impl.cpp server/ref_coun... |
Date: |
Fri, 06 Oct 2006 21:20:05 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Markus Gothe <nihilus> 06/10/06 21:20:05
Modified files:
. : ChangeLog
server : impl.cpp ref_counted.h
Log message:
Moved code to ref_counted.h
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1051&r2=1.1052
http://cvs.savannah.gnu.org/viewcvs/gnash/server/impl.cpp?cvsroot=gnash&r1=1.63&r2=1.64
http://cvs.savannah.gnu.org/viewcvs/gnash/server/ref_counted.h?cvsroot=gnash&r1=1.6&r2=1.7
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1051
retrieving revision 1.1052
diff -u -b -r1.1051 -r1.1052
--- ChangeLog 6 Oct 2006 15:15:49 -0000 1.1051
+++ ChangeLog 6 Oct 2006 21:20:05 -0000 1.1052
@@ -1,3 +1,7 @@
+2006-10-06 Markus Gothe <address@hidden>
+
+ * server/impl.cpp, server/ref_counted.h: Moved code to ref_counted.h
+
2006-10-06 Bastiaan Jacques <address@hidden>
* gui/Makefile.am: Automake directives may not be indented, so remove
Index: server/impl.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/impl.cpp,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -b -r1.63 -r1.64
--- server/impl.cpp 3 Oct 2006 12:01:07 -0000 1.63
+++ server/impl.cpp 6 Oct 2006 21:20:05 -0000 1.64
@@ -36,7 +36,7 @@
//
//
-/* $Id: impl.cpp,v 1.63 2006/10/03 12:01:07 nihilus Exp $ */
+/* $Id: impl.cpp,v 1.64 2006/10/06 21:20:05 nihilus Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -155,62 +155,6 @@
assert(loader_registered);
}
-//
-// ref_counted
-//
-
-
-ref_counted::ref_counted()
- :
- m_ref_count(0),
- m_weak_proxy(0)
-{
-}
-
-ref_counted::~ref_counted()
-{
- assert(m_ref_count == 0);
-
- if (m_weak_proxy)
- {
- m_weak_proxy->notify_object_died();
- m_weak_proxy->drop_ref();
- }
-}
-
-void ref_counted::add_ref() const
-{
- assert(m_ref_count >= 0);
- m_ref_count++;
-}
-
-void ref_counted::drop_ref() const
-{
- assert(m_ref_count > 0);
- m_ref_count--;
- if (m_ref_count <= 0)
- {
- // Delete me!
- delete this;
- }
-}
-
-weak_proxy* ref_counted::get_weak_proxy() const
-{
- assert(m_ref_count > 0); // By rights, somebody should be holding a ref
to us.
-
- if (m_weak_proxy == NULL) // Host calls this to register a function for
progress bar handling
- // during loading movies.
-
- {
- m_weak_proxy = new weak_proxy;
- m_weak_proxy->add_ref();
- }
-
- return m_weak_proxy;
-}
-
-
static void ensure_loaders_registered()
{
using namespace SWF::tag_loaders;
Index: server/ref_counted.h
===================================================================
RCS file: /sources/gnash/gnash/server/ref_counted.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- server/ref_counted.h 26 Sep 2006 07:53:28 -0000 1.6
+++ server/ref_counted.h 6 Oct 2006 21:20:05 -0000 1.7
@@ -35,7 +35,7 @@
//
//
-/* $Id: ref_counted.h,v 1.6 2006/09/26 07:53:28 nihilus Exp $ */
+/* $Id: ref_counted.h,v 1.7 2006/10/06 21:20:05 nihilus Exp $ */
#ifndef GNASH_REF_COUNTED_H
#define GNASH_REF_COUNTED_H
@@ -54,7 +54,7 @@
/// The only use for this class seems to be for putting derived
/// classes in smart_ptr
/// TODO: remove use of this base class in favor of using
-/// boost::shared_ptr<>
+/// boost::shared_ptr<> ???? boost::intrusive_ptr(?)
///
class DSOEXPORT ref_counted
@@ -63,12 +63,46 @@
mutable int m_ref_count;
mutable weak_proxy* m_weak_proxy;
public:
- ref_counted();
- virtual ~ref_counted();
- void add_ref() const;
- void drop_ref() const;
+ ref_counted()
+ :
+ m_ref_count(0),
+ m_weak_proxy(0)
+ {
+ }
+ virtual ~ref_counted()
+ {
+ assert(m_ref_count == 0);
+ if (m_weak_proxy){
+ m_weak_proxy->notify_object_died();
+ m_weak_proxy->drop_ref();
+ }
+ }
+ void add_ref() const {
+ assert(m_ref_count >= 0);
+ m_ref_count++;
+ }
+ void drop_ref() const {
+ assert(m_ref_count > 0);
+ m_ref_count--;
+ if (m_ref_count <= 0){
+ // Delete me!
+ delete this;
+ }
+ }
+
int get_ref_count() const { return m_ref_count; }
- weak_proxy* get_weak_proxy() const;
+ weak_proxy* get_weak_proxy() const {
+
+ assert(m_ref_count > 0); // By rights, somebody should be
holding a ref to us.
+ if (m_weak_proxy == NULL) // Host calls this to register a
function for progress bar handling
+ // during loading movies.
+
+ {
+ m_weak_proxy = new weak_proxy;
+ m_weak_proxy->add_ref();
+ }
+ return m_weak_proxy;
+ }
};
} // namespace gnash
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/impl.cpp server/ref_coun...,
Markus Gothe <=