From 0e56160e859d32adffb7c9df3cd78cde0bff8df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Fri, 15 Jul 2022 02:36:07 +0200 Subject: Don't crash on Prolog exceptions. In the future, it may be desirable to convert Prolog exceptions to C++ exceptions. --- c/main.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'c/main.cpp') diff --git a/c/main.cpp b/c/main.cpp index 2ae1c84..6a43e2c 100644 --- a/c/main.cpp +++ b/c/main.cpp @@ -27,7 +27,6 @@ static LRESULT CALLBACK CBTProc(int, WPARAM, LPARAM); static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); static INT_PTR CALLBACK AboutDlgProc(HWND, UINT, WPARAM, LPARAM); static HWND CreateStatusBar(HWND, HINSTANCE); -static int Attach(void); static void UpdateTheme(void); int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, @@ -63,7 +62,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, tszErr = TEXT("Could not initialize Prolog."); if (!PL_initialise(1, argv)) goto f; tszErr = TEXT("Could not attach databases."); - if (!Attach()) goto f; + if (!Pl("track_episodes","attach")) goto f; + if (!Pl("episode_data","attach")) goto f; /* Initialize common controls, load menu and register window class. */ INITCOMMONCONTROLSEX icc; @@ -486,16 +486,6 @@ HWND CreateStatusBar(HWND hWndParent, HINSTANCE hInstance) /***/ -/* Attach persistent databases. */ -int Attach() -{ - if (!Pl("track_episodes","attach")) return 0; - if (!Pl("episode_data","attach")) return 0; - return 1; -} - -/***/ - void UpdateLayout() { int cxColumn, cyDlv, yStatus; -- cgit v1.2.3