[PyKDE] How to apply patches to qt.py ?

Marc Schmitt littlewisp at gmx.net
Sun Oct 6 20:52:00 BST 2002


The following "solution" should work, at least until the problem will be 
solved in general.
Up to Adrian, it's an issue with the fast malloc used in SuSE qt version, 
which was applied 
to increase speed by about 10%. 

> the problem is that python is loaded first and qt is opened later via
> dlopen. Our qt has the fast malloc implementation which improves the speed
> for threaded apps a lot (and will be the default malloc in glibc 2.3).
> But the problem here is that malloc routine is exchanged later what
> caused the crash.

My workaround now would be to patch the file /%{python_site}/qt.py with the 
following code,
which should prevent Qt from using fast-malloc.

  # You should have received a copy of the GNU General Public License along 
with
  # PyQt; see the file LICENSE.  If not, write to the Free Software 
Foundation,
  # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

+
+ # hotfix for "fast malloc", not using this can cause crashes on some systems
+ from os import environ
+ environ["KDE_MALLOC"]="0"
+ del environ
+
+
  # Support for signals.

  def SLOT(slot):
        return '1' + slot



Where is the best/most elegant point to apply this ? I looked over the 
build.py script, but found no appropriate place.

Thanks
-Marc





More information about the PyQt mailing list