Author: rinrab
Date: Wed Apr 1 18:20:52 2026
New Revision: 1932713
Log:
svnbrowse: Add an iterpool into the mainloop so we don't leak temporary memory.
* subversion/svnbrowse/svnbrowse.c
(sub_main): Add iterpool and use it for all operations that need a pool for
intermediate data.
Modified:
subversion/trunk/subversion/svnbrowse/svnbrowse.c
Modified: subversion/trunk/subversion/svnbrowse/svnbrowse.c
==============================================================================
--- subversion/trunk/subversion/svnbrowse/svnbrowse.c Wed Apr 1 18:15:35 2026 (r1932712)
+++ subversion/trunk/subversion/svnbrowse/svnbrowse.c Wed Apr 1 18:20:52 2026 (r1932713)
@@ -145,6 +145,7 @@ static svn_error_t *
sub_main(int *code, int argc, char *argv[], apr_pool_t *pool)
{
svn_browse__ctx_t ctx = { 0 };
+ apr_pool_t *iterpool;
if (argc != 2)
return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
@@ -165,13 +166,17 @@ sub_main(int *code, int argc, char *argv
keypad(stdscr, TRUE);
nonl();
+ iterpool = svn_pool_create(pool);
+
while (TRUE)
{
+ svn_pool_clear(iterpool);
+
svn_browse__item_t *item;
const char *new_url;
clear();
- ui_draw(&ctx, pool);
+ ui_draw(&ctx, iterpool);
refresh();
/* getch() reads the next character/key with the following additional
@@ -197,14 +202,14 @@ sub_main(int *code, int argc, char *argv
case '\r':
item = APR_ARRAY_IDX(ctx.list, ctx.selection,
svn_browse__item_t *);
- new_url = svn_relpath_join(ctx.relpath, item->relpath, pool);
- SVN_ERR(enter_path(&ctx, new_url, pool));
+ new_url = svn_relpath_join(ctx.relpath, item->relpath, iterpool);
+ SVN_ERR(enter_path(&ctx, new_url, iterpool));
break;
case KEY_BACKSPACE:
case '-':
case 'u':
- new_url = svn_relpath_dirname(ctx.relpath, pool);
- SVN_ERR(enter_path(&ctx, new_url, pool));
+ new_url = svn_relpath_dirname(ctx.relpath, iterpool);
+ SVN_ERR(enter_path(&ctx, new_url, iterpool));
break;
/* TODO: quit via escape. some say just check for 27, but it I think it's
* a bit ugly. */
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.