Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8cf82ac

Browse files
author
Michael Meskes
committed
Ecpglib stores variables that are used in DECLARE statements in a global list.
This list is now freed when the last connection has been closed.Closes: #6366
1 parentdfd26f9 commit8cf82ac

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

‎src/interfaces/ecpg/ecpglib/connect.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,13 @@ ecpg_finish(struct connection * act)
149149
for (cache=act->cache_head;cache;ptr=cache,cache=cache->next,ecpg_free(ptr));
150150
ecpg_free(act->name);
151151
ecpg_free(act);
152+
/* delete cursor variables when last connection gets closed */
153+
if (all_connections==NULL)
154+
{
155+
structvar_list*iv_ptr;
156+
157+
for (;ivlist;iv_ptr=ivlist,ivlist=ivlist->next,ecpg_free(iv_ptr));
158+
}
152159
}
153160
else
154161
ecpg_log("ecpg_finish: called an extra time\n");

‎src/interfaces/ecpg/ecpglib/extern.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,15 @@ struct variable
121121
structvariable*next;
122122
};
123123

124+
structvar_list
125+
{
126+
intnumber;
127+
void*pointer;
128+
structvar_list*next;
129+
};
130+
131+
externstructvar_list*ivlist;
132+
124133
/* Here are some methods used by the lib. */
125134

126135
/* Returns a pointer to a string containing a simple type name. */

‎src/interfaces/ecpg/ecpglib/misc.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -501,12 +501,7 @@ ecpg_gettext(const char *msgid)
501501
}
502502
#endif/* ENABLE_NLS */
503503

504-
staticstructvar_list
505-
{
506-
intnumber;
507-
void*pointer;
508-
structvar_list*next;
509-
}*ivlist=NULL;
504+
structvar_list*ivlist=NULL;
510505

511506
void
512507
ECPGset_var(intnumber,void*pointer,intlineno)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp