Project

Profile

Help

Revision e090dcb1

Added by Michael Kay about 13 years ago

Fix bug 2283963 - NullReferenceException in close() method of .NET XSLT result document handler.

View differences:

latest9.1/bn/csource/api/Saxon.Api/Xslt.cs
830 830
    {
831 831

  
832 832
        private IResultDocumentHandler handler;
833
        private Hashtable resultMap = new Hashtable();
833
        private ArrayList resultList = new ArrayList();
834
        private ArrayList destinationList = new ArrayList();
834 835

  
835 836
        public ResultDocumentHandlerWrapper(IResultDocumentHandler handler)
836 837
        {
......
850 851
            }
851 852
            XmlDestination destination = handler.HandleResultDocument(href, baseUri);
852 853
            JResult result = destination.GetResult();
853
            resultMap.Add(result, destination);
854
            return destination.GetResult();
854
            resultList.Add(result);
855
            destinationList.Add(destination);
856
            return result;
855 857
        }
856 858

  
857 859
        public void close(JResult result)
858 860
        {
859
            XmlDestination destination = (XmlDestination)resultMap[result];
860
            destination.Close();
861
            for (int i = 0; i < resultList.Count; i++)
862
            {
863
                if (Object.ReferenceEquals(resultList[i], result))
864
                {
865
                    ((XmlDestination)destinationList[i]).Close();
866
                    resultList.RemoveAt(i);
867
                    destinationList.RemoveAt(i);
868
                    return;
869
                }
870
            }
861 871
        }
862 872
    }
863 873

  

Also available in: Unified diff