• Release COM Objects in AE


    When you codeing in Arc Engine, you need to consider the objects that you created, and if you leave so many unmanaged objects in the memory, and then you will find some wired activities.

    You may need:

      System.Runtime.InteropServices.Marshal.ReleaseComObject(pWorkFactory);

    Or, you may use the ComComReleaser in the ArcGIS assembly ESRI.ArcGIS.ADF.Connection.Local:

      ESRI.ArcGIS.ADF.ComReleaser.ReleaseCOMObject(pWorkFactory);

    You must release the cursors with used to reach the values, and the workspaces that you used to access data.

    When you get a cursor form a shpfile, then you will find a file like this in you disk:

      

    And if you use the WorkspaceEdit like that:

      IWorkspace workspace = ((IDataset)pFeatureClass_para).Workspace;
      IWorkspaceEdit workspaceEdit = workspace as IWorkspaceEdit;

      bool startEdit = workspaceEdit.IsBeingEdited();
      if (!startEdit)
      {
        workspaceEdit.StartEditing(false);
      }
      workspaceEdit.StartEditOperation();

    Then you will get a file like this:

      

    Then you need stop edit the work space, like this:

      workspaceEdit.StopEditOperation();
      startEdit = workspaceEdit.IsBeingEdited();
      while (startEdit)
      {
        workspaceEdit.StopEditing(true);
        startEdit = workspaceEdit.IsBeingEdited();
      }

  • 相关阅读:
    uniq 只能相邻行去重
    uniq 只能相邻行去重
    uniq 只能相邻行去重
    KVO(1)
    KVO(1)
    KVO(1)
    KVO(1)
    解决 Retrofit 多 BaseUrl 及运行时动态改变 BaseUrl ?
    jquery 请求成功后
    事故现场:MySQL 中一个双引号的错位引发的血案
  • 原文地址:https://www.cnblogs.com/henyihanwobushi/p/2983083.html
Copyright © 2020-2023  润新知