[Box Backup-dev] [PATCH] Win32 merge [05] bbackupd

Chris Wilson boxbackup-dev at fluffy.co.uk
Thu Aug 10 18:48:39 BST 2006


Hi Martin,

On Wed, 9 Aug 2006, Martin Ebourne wrote:

> There seems to be a change from "Win32BackupService gDaemonService" to 
> "Win32BackupService* gDaemonService", not sure which of the above that 
> relates to. Is it this memory leak fix?

Yes, if I remember correctly the problem is that Win32BackupService 
allocates memory in its constructor, which is tracked by Box memory leak 
detection, but this memory is not deallocated (because the object has not 
yet been destroyed) by the time we check for memory leaks, so it's 
reported as an error.

I wonder if there's a cleaner solution than making the global object into 
a global pointer?

> I don't like this defining globals in a .cpp file and then declaring
> them extern in another .cpp to get access. At the minimum the first .cpp
> file's .h file should be declaring them. Encapsulation would be even
> nicer if appropriate, I don't know anything about the windows API here
> apart from what I can guess from the code, so not sure on this.

Well, it was actually an attempt at encapsulation - the global variable is 
only accessed from one other file, so I didn't want to make it a publicly 
visible part of the API. By encapsulation, did you mean creating a 
separate header file for this declaration, or a separate cpp/h file 
combination for the class in question, or something else?

> These should be part of the same changeset that adds the code back into 
> Daemon.cpp. Then there would be no breakage and everything would be 
> consistent. Prefer change based merge to file based merge. :)

OK, will do when appropriate.

Cheers, Chris.
-- 
_ ___ __     _
  / __/ / ,__(_)_  | Chris Wilson <0000 at qwirx.com> - Cambs UK |
/ (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer |
\ _/_/_/_//_/___/ | We are GNU-free your mind-and your software |




More information about the Boxbackup-dev mailing list