default smart pointer type switched to intrusive_ptr

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@337 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-05-11 21:34:53 +00:00
parent 3b6743b110
commit 33fd2b5e18
103 changed files with 368 additions and 256 deletions
+3 -3
View File
@@ -33,19 +33,19 @@ class PackageManager {
/// Open a package with the specified name (including extension)
template <typename T>
shared_ptr<T> open(const String& name) {
intrusive_ptr<T> open(const String& name) {
wxFileName fn(data_directory + _("/") + name);
fn.Normalize();
String filename = fn.GetFullPath();
// Is this package already loaded?
PackagedP& p = loaded_packages[filename];
shared_ptr<T> typedP = dynamic_pointer_cast<T>(p);
intrusive_ptr<T> typedP = dynamic_pointer_cast<T>(p);
if (typedP) {
typedP->loadFully();
return typedP;
} else {
// not loaded, or loaded with wrong type (i.e. with just_header)
p = typedP = new_shared<T>();
p = typedP = new_intrusive<T>();
typedP->open(filename);
return typedP;
}