fixed some uninited members and locks

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17114 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval
2006-04-12 19:35:54 +00:00
parent 190b4fa4ef
commit 7008829b0f
5 changed files with 27 additions and 22 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
* *
* Authors: * Authors:
* Michael Phipps * Michael Phipps
* Jérôme Duval, [email protected] * Jérôme Duval, [email protected]
*/ */
#include <Application.h> #include <Application.h>
#include <Screen.h> #include <Screen.h>
+2 -2
View File
@@ -4,7 +4,7 @@
* *
* Authors: * Authors:
* Michael Phipps * Michael Phipps
* Jérôme Duval, [email protected] * Jérôme Duval, [email protected]
*/ */
#ifndef PASSWORDWINDOW_H #ifndef PASSWORDWINDOW_H
@@ -26,7 +26,7 @@ class PasswordWindow : public BWindow
void Setup(void); void Setup(void);
const char *GetPassword(void) {return fPassword->Text();} const char *GetPassword(void) {return fPassword->Text();}
void SetPassword(const char* text) { Lock(); fPassword->SetText(text); fPassword->MakeFocus(true); Unlock(); } void SetPassword(const char* text) { if (Lock()) { fPassword->SetText(text); fPassword->MakeFocus(true); Unlock();} }
bool fDie; bool fDie;
private: private:
+1 -1
View File
@@ -4,7 +4,7 @@
* *
* Authors: * Authors:
* Michael Phipps * Michael Phipps
* Jérôme Duval, [email protected] * Jérôme Duval, [email protected]
*/ */
#include "SSAwindow.h" #include "SSAwindow.h"
#include <View.h> #include <View.h>
+22 -17
View File
@@ -4,7 +4,7 @@
* *
* Authors: * Authors:
* Michael Phipps * Michael Phipps
* Jérôme Duval, [email protected] * Jérôme Duval, [email protected]
*/ */
#include <Debug.h> #include <Debug.h>
#include <stdio.h> #include <stdio.h>
@@ -36,6 +36,9 @@ int main(int, char**)
ScreenSaverApp::ScreenSaverApp() ScreenSaverApp::ScreenSaverApp()
: BApplication(SCREEN_BLANKER_SIG), : BApplication(SCREEN_BLANKER_SIG),
fWin(NULL), fWin(NULL),
fSaver(NULL),
fThrd(NULL),
fPww(NULL),
fThreadID(-1), fThreadID(-1),
fRunner(NULL) fRunner(NULL)
{ {
@@ -73,16 +76,17 @@ ScreenSaverApp::ReadyToRun()
void void
ScreenSaverApp::ShowPW() ScreenSaverApp::ShowPW()
{ {
fWin->Lock(); if (fWin->Lock()) {
if (fThreadID > -1) if (fThreadID > -1)
suspend_thread(fThreadID); suspend_thread(fThreadID);
if (B_OK==fWin->SetFullScreen(false)) { if (B_OK==fWin->SetFullScreen(false)) {
fWin->Sync(); fWin->Sync();
ShowCursor(); ShowCursor();
fPww->Show(); fPww->Show();
fPww->Sync(); fPww->Sync();
}
fWin->Unlock();
} }
fWin->Unlock();
delete fRunner; delete fRunner;
fRunner = new BMessageRunner(BMessenger(this), new BMessage(RESUME_SAVER), fPref.BlankTime(), 1); fRunner = new BMessageRunner(BMessenger(this), new BMessage(RESUME_SAVER), fPref.BlankTime(), 1);
if (fRunner->InitCheck() != B_OK) { if (fRunner->InitCheck() != B_OK) {
@@ -112,14 +116,15 @@ ScreenSaverApp::MessageReceived(BMessage *message)
break; break;
} }
case RESUME_SAVER: case RESUME_SAVER:
fWin->Lock(); if (fWin->Lock()) {
if (B_OK==fWin->SetFullScreen(true)) { if (B_OK==fWin->SetFullScreen(true)) {
HideCursor(); HideCursor();
fPww->Hide(); fPww->Hide();
}
if (fThreadID > -1)
resume_thread(fThreadID);
fWin->Unlock();
} }
if (fThreadID > -1)
resume_thread(fThreadID);
fWin->Unlock();
default: default:
BApplication::MessageReceived(message); BApplication::MessageReceived(message);
break; break;
+1 -1
View File
@@ -4,7 +4,7 @@
* *
* Authors: * Authors:
* Michael Phipps * Michael Phipps
* Jérôme Duval, [email protected] * Jérôme Duval, [email protected]
*/ */
#ifndef SCREEN_SAVER_APP_H #ifndef SCREEN_SAVER_APP_H