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:
* Michael Phipps
* Jérôme Duval, [email protected]
* Jérôme Duval, [email protected]
*/
#include <Application.h>
#include <Screen.h>
+2 -2
View File
@@ -4,7 +4,7 @@
*
* Authors:
* Michael Phipps
* Jérôme Duval, [email protected]
* Jérôme Duval, [email protected]
*/
#ifndef PASSWORDWINDOW_H
@@ -26,7 +26,7 @@ class PasswordWindow : public BWindow
void Setup(void);
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;
private:
+1 -1
View File
@@ -4,7 +4,7 @@
*
* Authors:
* Michael Phipps
* Jérôme Duval, [email protected]
* Jérôme Duval, [email protected]
*/
#include "SSAwindow.h"
#include <View.h>
+8 -3
View File
@@ -4,7 +4,7 @@
*
* Authors:
* Michael Phipps
* Jérôme Duval, [email protected]
* Jérôme Duval, [email protected]
*/
#include <Debug.h>
#include <stdio.h>
@@ -36,6 +36,9 @@ int main(int, char**)
ScreenSaverApp::ScreenSaverApp()
: BApplication(SCREEN_BLANKER_SIG),
fWin(NULL),
fSaver(NULL),
fThrd(NULL),
fPww(NULL),
fThreadID(-1),
fRunner(NULL)
{
@@ -73,7 +76,7 @@ ScreenSaverApp::ReadyToRun()
void
ScreenSaverApp::ShowPW()
{
fWin->Lock();
if (fWin->Lock()) {
if (fThreadID > -1)
suspend_thread(fThreadID);
if (B_OK==fWin->SetFullScreen(false)) {
@@ -83,6 +86,7 @@ ScreenSaverApp::ShowPW()
fPww->Sync();
}
fWin->Unlock();
}
delete fRunner;
fRunner = new BMessageRunner(BMessenger(this), new BMessage(RESUME_SAVER), fPref.BlankTime(), 1);
if (fRunner->InitCheck() != B_OK) {
@@ -112,7 +116,7 @@ ScreenSaverApp::MessageReceived(BMessage *message)
break;
}
case RESUME_SAVER:
fWin->Lock();
if (fWin->Lock()) {
if (B_OK==fWin->SetFullScreen(true)) {
HideCursor();
fPww->Hide();
@@ -120,6 +124,7 @@ ScreenSaverApp::MessageReceived(BMessage *message)
if (fThreadID > -1)
resume_thread(fThreadID);
fWin->Unlock();
}
default:
BApplication::MessageReceived(message);
break;
+1 -1
View File
@@ -4,7 +4,7 @@
*
* Authors:
* Michael Phipps
* Jérôme Duval, [email protected]
* Jérôme Duval, [email protected]
*/
#ifndef SCREEN_SAVER_APP_H