diff --git a/widget/windows/JumpListBuilder.cpp b/widget/windows/JumpListBuilder.cpp index 52b5f084095..6894402bf7c 100644 --- a/widget/windows/JumpListBuilder.cpp +++ b/widget/windows/JumpListBuilder.cpp @@ -56,6 +56,10 @@ #include "nsStringStream.h" #include "nsNetUtil.h" #include "nsThreadUtils.h" +#include "mozilla/LazyIdleThread.h" + +// The amount of time, in milliseconds, that our IO thread will stay alive after the last event it processes. +#define DEFAULT_THREAD_TIMEOUT_MS 30000 namespace mozilla { namespace widget { @@ -85,7 +89,8 @@ JumpListBuilder::JumpListBuilder() : CoCreateInstance(CLSID_DestinationList, NULL, CLSCTX_INPROC_SERVER, IID_ICustomDestinationList, getter_AddRefs(mJumpListMgr)); - NS_NewThread(getter_AddRefs(mIOThread)); + // Make a lazy thread for any IO + mIOThread = new LazyIdleThread(DEFAULT_THREAD_TIMEOUT_MS, LazyIdleThread::ManualShutdown); Preferences::AddStrongObserver(this, kPrefTaskbarEnabled); }