• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision23123 (tree)
Zeit2012-08-03 03:44:40
Autorstefankueng

Log Message

In case creating the client context fails, check for the invalid context and in case it's invalid, make sure the path gets crawled again.
(Fixes issue #383) : access violation if context creation fails

Ändern Zusammenfassung

Diff

--- trunk/src/Changelog.txt (revision 23122)
+++ trunk/src/Changelog.txt (revision 23123)
@@ -108,6 +108,8 @@
108108 log cache. (Stefan Fuhrmann)
109109 - BUG: Issue #382: Don't crash in log cache when path
110110 info is not available. (Stefan Fuhrmann)
111+- BUG: Issue #383: access violation if context
112+ creation fails. (Stefan)
111113
112114 Version 1.7.7
113115 - BUG: Issue #233: Crash when closing the
--- trunk/src/SVN/SVNHelpers.cpp (revision 23122)
+++ trunk/src/SVN/SVNHelpers.cpp (revision 23123)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2011 - TortoiseSVN
3+// Copyright (C) 2003-2012 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -78,11 +78,14 @@
7878 if (pool == NULL)
7979 return m_ctx;
8080
81- svn_client_ctx_t * ctx;
81+ svn_client_ctx_t * ctx = nullptr;
8282 svn_error_clear(svn_client_create_context(&ctx, pool));
83- ctx->cancel_func = cancelfunc;
84- ctx->cancel_baton = (void *)this;
85- ctx->config = m_config;
83+ if (ctx)
84+ {
85+ ctx->cancel_func = cancelfunc;
86+ ctx->cancel_baton = (void *)this;
87+ ctx->config = m_config;
88+ }
8689
8790 return ctx;
8891 }
--- trunk/src/TSVNCache/CachedDirectory.cpp (revision 23122)
+++ trunk/src/TSVNCache/CachedDirectory.cpp (revision 23123)
@@ -513,28 +513,41 @@
513513 return false;
514514 }
515515 m_pCtx = CSVNStatusCache::Instance().m_svnHelp.ClientContext(subPool);
516- svn_error_t* pErr = svn_client_status5 (
517- NULL,
518- m_pCtx,
519- svnapipath,
520- &revision,
521- svn_depth_immediates,
522- TRUE, // get all
523- FALSE, // update
524- TRUE, // no ignores
525- FALSE, // ignore externals
526- TRUE, // depth as sticky
527- NULL, // changelists
528- GetStatusCallback,
529- this,
530- subPool
531- );
516+ svn_error_t * pErr = nullptr;
517+ if (m_pCtx)
518+ {
519+ pErr = svn_client_status5 (
520+ NULL,
521+ m_pCtx,
522+ svnapipath,
523+ &revision,
524+ svn_depth_immediates,
525+ TRUE, // get all
526+ FALSE, // update
527+ TRUE, // no ignores
528+ FALSE, // ignore externals
529+ TRUE, // depth as sticky
530+ NULL, // changelists
531+ GetStatusCallback,
532+ this,
533+ subPool
534+ );
532535
533- svn_wc_context_destroy(m_pCtx->wc_ctx);
534- m_pCtx->wc_ctx = NULL;
535- m_pCtx = NULL;
536+ svn_wc_context_destroy(m_pCtx->wc_ctx);
537+ m_pCtx->wc_ctx = NULL;
538+ m_pCtx = NULL;
539+ }
540+ else
541+ {
542+ CTraceToOutputDebugString::Instance()(__FUNCTION__ ": error creating client context!\n");
543+ m_currentFullStatus = m_mostImportantFileStatus = svn_wc_status_none;
544+ // Since we only assume a none status here due to the fact that we couldn't get a client context,
545+ // make sure that this status times out soon.
546+ CSVNStatusCache::Instance().m_folderCrawler.BlockPath(m_directoryPath, 20);
547+ CSVNStatusCache::Instance().AddFolderForCrawling(m_directoryPath);
548+ }
536549 InterlockedExchange(&m_FetchingStatus, FALSE);
537- if(pErr)
550+ if (pErr)
538551 {
539552 // Handle an error
540553 // The most likely error on a folder is that it's not part of a WC
Show on old repository browser