X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=null_prompt_service.cpp;h=03355acc10fdef70fff4319a994fc06961912d30;hb=a1498771369c19fb5980b5a6e5f7767a0404d4e8;hp=878f7ff268f71057127e1f997287ad0b024d0077;hpb=c5f98ff303d670f72a5d491a5f4e1989d2043219;p=videolink.git diff --git a/null_prompt_service.cpp b/null_prompt_service.cpp index 878f7ff..03355ac 100644 --- a/null_prompt_service.cpp +++ b/null_prompt_service.cpp @@ -1,6 +1,7 @@ // Copyright 2006 Ben Hutchings . // See the file "COPYING" for licence details. +#include #include #include @@ -13,7 +14,7 @@ #include #include "null_prompt_service.hpp" -#include "webdvd.hpp" +#include "videolink.hpp" #include "xpcom_support.hpp" using xpcom_support::check; @@ -36,12 +37,14 @@ 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; }