diff --git a/aegisub/build/libaegisub_vs2008/libaegisub_vs2008.vcproj b/aegisub/build/libaegisub_vs2008/libaegisub_vs2008.vcproj
index 4eefbdc4b..88e58694c 100644
--- a/aegisub/build/libaegisub_vs2008/libaegisub_vs2008.vcproj
+++ b/aegisub/build/libaegisub_vs2008/libaegisub_vs2008.vcproj
@@ -449,6 +449,10 @@
RelativePath="..\..\libaegisub\include\libaegisub\path.h"
>
+
+
diff --git a/aegisub/libaegisub/include/libaegisub/scoped_ptr.h b/aegisub/libaegisub/include/libaegisub/scoped_ptr.h
new file mode 100644
index 000000000..c0d25e209
--- /dev/null
+++ b/aegisub/libaegisub/include/libaegisub/scoped_ptr.h
@@ -0,0 +1,54 @@
+// Copyright (c) 2010, Thomas Goyne
+//
+// Permission to use, copy, modify, and distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+//
+// $Id$
+
+/// @file scoped_ptr.h
+/// @brief
+/// @ingroup libaegisub
+
+#pragma once
+
+namespace agi {
+
+/// @class scoped_ptr
+/// @brief auto_ptr without the transfer of ownership semantics
+template
+class scoped_ptr {
+ T* ptr;
+ scoped_ptr(scoped_ptr const&);
+ scoped_ptr& operator=(scoped_ptr const&);
+public:
+ typedef T element_type;
+
+ T& operator*() const {return *ptr; }
+ T* operator->() const { return ptr; }
+ T* get() const { return ptr; }
+
+ void reset(T *p = NULL) {
+ delete ptr;
+ ptr = p;
+ }
+
+ void swap(scoped_ptr &b) { using std::swap; swap(ptr, b.ptr); }
+
+ scoped_ptr(T *ptr = NULL) : ptr(ptr){ }
+ ~scoped_ptr() { delete ptr; }
+};
+
+template
+inline void swap(scoped_ptr &a, scoped_ptr &b) {
+ a.swap(b);
+}
+}