diff options
author | George Hazan <george.hazan@gmail.com> | 2013-06-30 20:10:41 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-06-30 20:10:41 +0000 |
commit | 916709315ea2044a31adfc0e5b2809fe712358f3 (patch) | |
tree | f9aa0dbe9507dd3a36b5167a83608ba9765ed5a4 /protocols/Gadu-Gadu/src/gg_proto.cpp | |
parent | 8d3522f82f331954a495275a0e23402906d9bb9a (diff) |
- major cleanup of GG avatar code
- fix for hangup on exit
git-svn-id: http://svn.miranda-ng.org/main/trunk@5198 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Gadu-Gadu/src/gg_proto.cpp')
-rw-r--r-- | protocols/Gadu-Gadu/src/gg_proto.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index b98bf1fda9..22b2a5e57d 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -21,7 +21,9 @@ #include "gg.h"
-GGPROTO::GGPROTO(const char* pszProtoName, const TCHAR* tszUserName)
+GGPROTO::GGPROTO(const char* pszProtoName, const TCHAR* tszUserName) :
+ avatar_requests(1, HandleKeySortT),
+ avatar_transfers(1, HandleKeySortT)
{
ProtoConstructor(this, pszProtoName, tszUserName);
@@ -65,6 +67,8 @@ GGPROTO::GGPROTO(const char* pszProtoName, const TCHAR* tszUserName) setalloffline();
db_set_dw(NULL, m_szModuleName, GG_KEY_LOGONTIME, 0);
+ db_set_resident(m_szModuleName, GG_KEY_AVATARREQUESTED);
+
TCHAR szPath[MAX_PATH];
mir_sntprintf(szPath, MAX_PATH, _T("%s\\%s"), (TCHAR*)VARST( _T("%miranda_avatarcache%")), m_tszUserName);
hAvatarsFolder = FoldersRegisterCustomPathT(LPGEN("Avatars"), m_szModuleName, szPath, m_tszUserName);
@@ -804,21 +808,15 @@ int GGPROTO::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam) block_init();
// Try to fetch user avatar
- getUserAvatar();
+ getOwnAvatar();
break;
}
case EV_PROTO_ONEXIT:
// Stop avatar request thread
- uninitavatarrequestthread();
+ pth_avatar.dwThreadId = 0;
// Stop main connection session thread
-#ifdef DEBUGMODE
- netlog("OnEvent(): EV_PROTO_ONEXIT: Waiting pth_sess thread.");
-#endif
- threadwait(&pth_sess);
-#ifdef DEBUGMODE
- netlog("OnEvent(): EV_PROTO_ONEXIT: Waiting pth_sess thread - OK");
-#endif
+ pth_sess.dwThreadId = 0;
img_shutdown();
sessions_closedlg();
|