Skip to content

Commit

Permalink
Merge pull request #1 from GeertvanHorrik/pr/typo
Browse files Browse the repository at this point in the history
Fixed typo in ScopedResourceUpdater
  • Loading branch information
zcbenz committed Mar 9, 2015
2 parents 50e9c4c + 371e834 commit f2e68e8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions src/rescle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ bool ResourceUpdater::Commit() {
FreeLibrary(hModule);
hModule = NULL;

ScopedResoueceUpdater ru(filename.c_str(), false);
ScopedResourceUpdater ru(filename.c_str(), false);
if (ru.Get() == NULL) {
return false;
}
Expand Down Expand Up @@ -453,7 +453,7 @@ bool ResourceUpdater::UpdateRaw
, const size_t& dataSize
, const bool& deleteOld) {

ScopedResoueceUpdater ru(filename, deleteOld);
ScopedResourceUpdater ru(filename, deleteOld);
if (ru.Get() == NULL) {
return false;
}
Expand Down Expand Up @@ -622,28 +622,28 @@ BOOL CALLBACK ResourceUpdater::OnEnumResourceName(HMODULE hModule, LPCTSTR lpszT
return TRUE;
}

ScopedResoueceUpdater::ScopedResoueceUpdater(const char* filename, const bool& deleteOld)
ScopedResourceUpdater::ScopedResourceUpdater(const char* filename, const bool& deleteOld)
: handle(NULL)
, commited(false) {
handle = BeginUpdateResource(filename, deleteOld ? TRUE : FALSE);
}

ScopedResoueceUpdater::~ScopedResoueceUpdater() {
ScopedResourceUpdater::~ScopedResourceUpdater() {
if (!commited) {
EndUpdate(false);
}
}

HANDLE ScopedResoueceUpdater::Get() const {
HANDLE ScopedResourceUpdater::Get() const {
return handle;
}

bool ScopedResoueceUpdater::Commit() {
bool ScopedResourceUpdater::Commit() {
commited = true;
return EndUpdate(true);
}

bool ScopedResoueceUpdater::EndUpdate(const bool& doesCommit) {
bool ScopedResourceUpdater::EndUpdate(const bool& doesCommit) {
BOOL fDiscard = doesCommit ? FALSE : TRUE;
BOOL bResult = EndUpdateResource(handle, fDiscard);
DWORD e = GetLastError();
Expand Down
6 changes: 3 additions & 3 deletions src/rescle.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ class ResourceUpdater {
IconsValue icon;
};

class ScopedResoueceUpdater {
class ScopedResourceUpdater {
public:
ScopedResoueceUpdater(const char* filename, const bool& deleteOld);
~ScopedResoueceUpdater();
ScopedResourceUpdater(const char* filename, const bool& deleteOld);
~ScopedResourceUpdater();

HANDLE Get() const;
bool Commit();
Expand Down

0 comments on commit f2e68e8

Please sign in to comment.