Fixing crash when no profile directory exists.

This commit is contained in:
dougt%meer.net 2006-04-18 21:06:51 +00:00
parent 9b0fa55141
commit fdb6b63a3a
5 changed files with 18 additions and 1 deletions

View File

@ -83,6 +83,7 @@ REQUIRES = xpcom \
phone \
js \
imglib2 \
toolkitcomps \
$(NULL)
CPPSRCS = Minimo.cpp \

View File

@ -470,10 +470,14 @@ nsresult StartupProfile()
if (NS_FAILED(rv))
return rv;
appDataDir->Create(nsIFile::DIRECTORY_TYPE, 0700);
rv = appDataDir->Append(NS_LITERAL_STRING("minimo"));
if (NS_FAILED(rv))
return rv;
appDataDir->Create(nsIFile::DIRECTORY_TYPE, 0700);
nsCOMPtr<nsILocalFile> localAppDataDir(do_QueryInterface(appDataDir));
nsCOMPtr<nsProfileDirServiceProvider> locProvider;
@ -704,6 +708,14 @@ int main(int argc, char *argv[])
return 1;
}
nsCOMPtr<nsICommandLineRunner> cmdLine = do_CreateInstance("@mozilla.org/toolkit/command-line;1");
nsCOMPtr<nsIFile> workingDir;
NS_GetSpecialDirectory(NS_OS_CURRENT_WORKING_DIR, getter_AddRefs(workingDir));
if (cmdLine)
cmdLine->Init(argc, argv, workingDir, nsICommandLine::STATE_INITIAL_LAUNCH);
appShell->Create(nsnull, nsnull);
ApplicationObserver *appObserver = new ApplicationObserver(appShell);

View File

@ -61,6 +61,7 @@
#include "nsIAppStartupNotifier.h"
#include "nsIBadCertListener.h"
#include "nsIClipboardCommands.h"
#include "nsICommandLineRunner.h"
#include "nsIComponentRegistrar.h"
#include "nsIDOMWindow.h"
#include "nsIEventQueueService.h"

View File

@ -83,7 +83,7 @@ WindowCreator::CreateChromeWindow2(nsIWebBrowserChrome *aParent,
nsCOMPtr<nsIXULWindow> xulParent(do_GetInterface(aParent));
appShell->CreateTopLevelWindow(xulParent, // get rid of if you undef above
appShell->CreateTopLevelWindow(xulParent,
0,
aChromeFlags,
x,

View File

@ -56,5 +56,8 @@ include $(topsrcdir)/config/config.mk
LOCAL_INCLUDES += -I$(srcdir)/.
OS_LIBS += $(call EXPAND_LIBNAME, aygshell cellcore uuid ole32 oleaut32)
# default size is 1mb which is way to much for this app.
LDFLAGS += -STACK:65536
include $(topsrcdir)/config/rules.mk