[Mono-bugs] [Bug 397824] New: ServiceContainere. RemoveService does not remove specified service

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Jun 6 04:21:13 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=397824


           Summary: ServiceContainere.RemoveService does not remove
                    specified service
           Product: Mono: Class Libraries
           Version: 1.9.0
          Platform: i686
        OS/Version: Windows Vista
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: migelU at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Development


System.ComponentModel.Design.ServiceContainer does not remove required service.
Here is program to reproduce bug:

using System;
using System.Collections;
using System.ComponentModel.Design;

namespace Mono.Tests
{
        class ServiceTest
        {
                ServiceContainer _service = new ServiceContainer();

                /// <summary>
                /// The main entry point for the application.
                /// </summary>
                private static int Main()
                {
                        ServiceTest test = new ServiceTest();
                        test.TestNonGeneric(); 
                        return 0;
                }

                private void TestNonGeneric()
                {
                        Console.WriteLine("Non generic test start");
                        Console.WriteLine("\tPublishing");
                        ArrayList list = new ArrayList();
                        PublishService(typeof(IEnumerable), list);
                        PublishService(typeof(IEnumerable), list);
                        PublishService(typeof(IEnumerable), list);
                        Console.WriteLine("\tPublished");
                        Console.WriteLine("Non generic test finish");
                }


                private void PublishService(Type svcType, object service)
                {
                        if (_service.GetService(svcType) != null)
                        {
                                Console.WriteLine("\t Service Republished");
                                _service.RemoveService(svcType);
                                Console.WriteLine("\t Service removed ? {0}",
_service.GetService(svcType) == null);
                        }

                        _service.AddService(svcType, service);
                }
        }
}


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list