aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--c/episodelistview.cpp3
-rw-r--r--c/pl.cpp10
-rw-r--r--c/pl.h8
3 files changed, 21 insertions, 0 deletions
diff --git a/c/episodelistview.cpp b/c/episodelistview.cpp
index d3abf74..d43c3a7 100644
--- a/c/episodelistview.cpp
+++ b/c/episodelistview.cpp
@@ -284,6 +284,7 @@ void EpisodeListView::Update()
if (!Pl("episode_data","episode_count",&cEp)) return;
for (iEp = 1, iItem = 0; iEp <= cEp; iEp++) {
+ Mark m;
extern char g_szLimitScreenwriter[];
extern int g_bViewTVOriginal, g_bViewWatched;
@@ -355,6 +356,7 @@ void EpisodeListView::Update()
/* Update episode name and rating. */
void EpisodeListView::UpdateItem(const LVITEM* const pLvi)
{
+ Mark m;
TCHAR* tszName;
int iRating;
static TCHAR tszRating[3];
@@ -427,6 +429,7 @@ int CALLBACK ElvSort(const LPARAM iItem1, const LPARAM iItem2, const LPARAM lExt
}
case ELVSITITLE:
{
+ Mark m;
char* sz1,* sz2;
int cch, cch1, cch2;
if (!Pl("episode_data","episode_title",lvi1.lParam,&sz1))
diff --git a/c/pl.cpp b/c/pl.cpp
index a40865f..fb3d4af 100644
--- a/c/pl.cpp
+++ b/c/pl.cpp
@@ -28,6 +28,16 @@ void Frame::Rewind()
PL_rewind_foreign_frame(m_f);
}
+Mark::Mark()
+{
+ PL_mark_string_buffers(&m_m);
+}
+
+Mark::~Mark()
+{
+ PL_release_string_buffers_from_mark(m_m);
+}
+
Query::Query(const module_t ctx, const predicate_t p, const term_t t0)
{
m_q = PL_open_query(ctx, PL_Q_CATCH_EXCEPTION, p, t0);
diff --git a/c/pl.h b/c/pl.h
index 4268dad..d4bf18b 100644
--- a/c/pl.h
+++ b/c/pl.h
@@ -18,6 +18,14 @@ private:
fid_t m_f;
};
+struct Mark
+{
+ Mark();
+ ~Mark();
+private:
+ buf_mark_t m_m;
+};
+
struct Query
{
Query(module_t ctx, predicate_t p, term_t t0);