Fixed Nabi Issues
[apps/osp/Internet.git] / src / IntHistoryPresentationModel.cpp
index 4159c15..cabc82f 100644 (file)
@@ -70,6 +70,7 @@ void HistoryPresentationModel::DestroyInstance(void)
 {
        if (__pHistoryPresentationModel)
        {
+               __pHistoryPresentationModel->UnInitialize();
                delete __pHistoryPresentationModel;
                __pHistoryPresentationModel = null;
        }
@@ -413,6 +414,12 @@ HistoryPresentationModel::SaveTempHistory(History& history)
                }
        }
 
+       if (pTodaysList)
+       {
+               pTodaysList->RemoveAll();
+               delete pTodaysList;
+       }
+
        pMostVisitedSites = new(std::nothrow) ArrayList();
        pMostVisitedSites->Construct();
        String historyTitle = history.GetHistoryTitle();
@@ -880,7 +887,7 @@ HistoryPresentationModel::CreateHistoryList(int historyCount, ArrayList& history
                                        {
                                                pFavIconBuffer = new ByteBuffer();
                                                r = PresentationModelBase::GetColumn(columnCount, *pFavIconBuffer);
-                                               if (!IsFailed(r))
+                                               if (!IsFailed(r) && pFavIconBuffer->GetCapacity() > 0)
                                                {
                                                        pHistory->SetFavIconBuffer(*pFavIconBuffer);
                                                }
@@ -1032,7 +1039,7 @@ HistoryPresentationModel::GetSearchHistoryCount(int& historyCount, String& text)
        query.Append(historyTable);
        query.Append(L".TITLE LIKE '%");
        query.Append(text);
-       query.Append("% 'ESCAPE '/')");
+       query.Append("%'ESCAPE '/')");
        query.Append(" OR ");
        query.Append(L"(");
        query.Append(historyTable);