Author: jbevain
Date: 2007-09-05 05:46:36 -0400 (Wed, 05 Sep 2007)
New Revision: 85343

Modified:
   trunk/moon/src/playlist.cpp
   trunk/moon/src/playlist.h
Log:
nullify current entry after it has been processed

Modified: trunk/moon/src/playlist.cpp
===================================================================
--- trunk/moon/src/playlist.cpp 2007-09-05 09:37:09 UTC (rev 85342)
+++ trunk/moon/src/playlist.cpp 2007-09-05 09:46:36 UTC (rev 85343)
@@ -275,6 +275,10 @@
 PlaylistParser::on_end_element (gpointer user_data, const char *name)
 {
        PlaylistParser *parser = reinterpret_cast<PlaylistParser *> (user_data);
+       switch (parser->GetCurrentKind ()) {
+       case Entry:
+               parser->EndEntry ();
+       }
        parser->PopCurrentKind ();
 }
 
@@ -306,7 +310,7 @@
                break;
        case Entry:
                parser->AssertParentKind (Asx);
-               parser->AddEntry ();
+               parser->OnEntry ();
                break;
        case StartTime:
                parser->AssertParentKind (Entry);
@@ -347,13 +351,18 @@
 }
 
 void
-PlaylistParser::AddEntry ()
+PlaylistParser::OnEntry ()
 {
        PlaylistEntry *entry = new PlaylistEntry ();
        playlist->AddEntry (entry);
        this->entry = entry;
 }
 
+void PlaylistParser::EndEntry ()
+{
+       this->entry = NULL;
+}
+
 void
 PlaylistParser::PushCurrentKind (PlaylistParser::PlaylistNodeKind kind)
 {

Modified: trunk/moon/src/playlist.h
===================================================================
--- trunk/moon/src/playlist.h   2007-09-05 09:37:09 UTC (rev 85342)
+++ trunk/moon/src/playlist.h   2007-09-05 09:46:36 UTC (rev 85343)
@@ -121,7 +121,8 @@
        static void on_end_element (gpointer user_data, const char *name);
        static void on_text (gpointer user_data, const char *text, int len);
 
-       void AddEntry ();
+       void OnEntry ();
+       void EndEntry ();
        PlaylistEntry *GetCurrentEntry ();
 
        PlaylistContent *GetCurrentContent ();

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to