]> git.decadent.org.uk Git - videolink.git/blobdiff - null_prompt_service.cpp
Made proper use of DESTDIR for installation.
[videolink.git] / null_prompt_service.cpp
index dca78103dbdb020e6cdaca48b2142e18b1395849..901c5880ce7ebc6affc9a90c65f6a8ab17133cee 100644 (file)
@@ -1,6 +1,7 @@
-// Copyright 2006 Ben Hutchings <ben@decadentplace.org.uk>.
+// Copyright 2006 Ben Hutchings <ben@decadent.org.uk>.
 // See the file "COPYING" for licence details.
 
+#include <new>
 #include <string>
 
 #include <langinfo.h>
@@ -13,7 +14,7 @@
 #include <nsIUnicodeEncoder.h>
 
 #include "null_prompt_service.hpp"
-#include "webdvd.hpp"
+#include "videolink.hpp"
 #include "xpcom_support.hpp"
 
 using xpcom_support::check;
@@ -36,18 +37,20 @@ namespace
        if (!iid.Equals(prompt_service_iid))
            return NS_ERROR_NO_INTERFACE;
 
-       try
+       if (null_prompt_service * service =
+               new (std::nothrow) null_prompt_service)
        {
-           *result = new null_prompt_service;
+           service->AddRef();
+           *result = service;
            return NS_OK;
        }
-       catch (std::bad_alloc &)
+       else
        {
            return NS_ERROR_OUT_OF_MEMORY;
        }
     }
 
-    NS_IMETHODIMP null_prompt_service_factory::LockFactory(PRBool lock)
+    NS_IMETHODIMP null_prompt_service_factory::LockFactory(PRBool /*lock*/)
     {
        return NS_ERROR_NOT_IMPLEMENTED;
     }